Setup MySQL

MySQL Installation

sudo apt-get -y install mysql-server mysql-client

  1. be sure to be root
  2. install mysql server + client

Secure the mysql Installation

sudo mysql_secure_installation

Enter password for user root: <– Enter the MySQL root password

Press y|Y for Yes, any other key for No: <– Press y if you want this function or press Enter otherwise.
Using existing password for root.
Change the password for root ? ((Press y|Y for Yes, any other key for No) : <– Press enter

Remove anonymous users? (Press y|Y for Yes, any other key for No) : <– y

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : <– y

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : <– y

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : <– y

All done!

MySQL is secured now.

(Update) if you update to the latest version of Ubuntu and you have problems to start the mysql-server visit this article

ubuntu-mysql-fix/

Leave a Reply