Setup MySQL Server on Ubuntu 16.04

Here’s a quick guide to setting up the popular database server MySQL on Ubuntu 16.04.
 

Install MySQL

Update repositories

sudo apt-get update

Install MySQL

sudo apt-get install mysql-server

Enter a root password when prompted

Secure the installation

sudo mysql_secure_installation

Personally, I don’t use the validate password plugin, keep my root password, disable remote root login and remove test databases. How you answer these questions will depend on the purpose of the install.

That’s it!

You can login through the command line with

mysql -u root -p

You’ll be prompted for the root password set during installation.

Leave a Reply

Your email address will not be published. Required fields are marked *