How to configure MySQL

By default the root password for MySQL is blank, but it is not safe.

Set the root password by entering the following in terminal.

mysqladmin -u root -p password 'password'

This will set the root password.

Now you can login to the MySQL using the password you have just created.

mysql -u root -p

This will ask you for the root password, just enter the password to access the MySQL console.

Forgot root password

If you have forgotten your MySQL root password. Don't worry, there is a way to reset it.

I will post another article to explain the process of reseting MySQL root password.