MySQL is the most widely used database engine. Many application use MySQL database. In this post, I will explain how to install MySQL on CentOS VPS.

1. Open terminal, and type command below :

sudo yum install mysql-server

sudo service mysqld start

2. MySQL will ask our permission twice. Type “Y” (Yes) for both question

3. Change root password. Type command below

sudo /usr/bin/mysql_secure_installation

MySQL will ask for current root password. Because it is our first install, then we don’t set any root password. So leave it empty, by pressing enter.

Enter current password for root (enter for none):

OK, successfully used password, moving on...

MySQL will ask our confirmation to set password for root.

Set root password? [Y/n] Y

New Password:

Re-enter new password:

4. MySQL will also ask us, if we want to  remove anonymous users. I recommend to remove this anonymous user for better security. Type “Y” (Yes).

Remove anonymous users?[Y/n] Y

5. MySQL will ask us to disallow remote root login. I recommend You to say yes, for security matter. Type “Y” (Yes).

Disallow root login remotely?[Y/n]  Y

6. MySQL will ask us to delete test database. I recommend You to say yes, for security matter. Type “Y” (Yes).

Remove test database and access to it?[Y/n] Y

7. Reload privilege tables. Type “Y” (Yes).

Reload privilege tables now?[Y/n] Y

8. Set MySQL service start automatically when the server boots.

sudo chkconfig mysqld on

 

That’s all. Thank You. Have a nice day ^_^

Tinggalkan komentar

I’m Riza

Welcome to my website. I’m happy to share my knowledge and experience here, especially related with my expertise in digital solution for enterprise. I’ll talk many topics around technology, AI, and others. Happy to know you!

You can find me in network platform below

Let’s connect