Ubuntu 18.04 install MySQL Server

Ubuntu 18.04 install MySQL Server

Installation for MySQL is slightly different in 18.04 as compared to 16.04.

sudo apt update
sudo apt install mysql-server -y
sudo mysql -uroot

Now in MySQL console, type the following to check the users.

select user,host,plugin from mysql.user;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'NEWPASSWORD';
update mysql.user set host='%' where user='root';
exit;

Comment the line bind-address if you like to listen on all addresses.

sudo service mysql restart