After the latest Ubuntu 16.04 update, I did what thousands and thousands of people did. I upgraded from 15.10 while using and older version of MySQL (5.6).

Testing the update

The first thing I did was confirm that my Ruby projects still worked and all started up. I pulled the latest from my project and ran a rake db:migrate and it failed. I then tried to connect to my local database mysql -u root -p (My MySQL setup locally has NO password: this is important to remember, this issue ONLY effects those with no password set for root). While I was updating I also notice that MySQL was upgraded from 5.6 to 5.7.

“Fix” MySQL 5.7 to work like it use to.

First we need to connect to mysql and by now you have found that you can not… Here is how:

sudo mysql -u root -p
(enter your sudo password)
(no password for mysql)

Now we need to alter the User table to remove the new auth_socket plugin.

mysql > UPDATE mysql.user SET plugin = "mysql_native_password" where User = 'root' AND plugin = "auth_socket";
mysql> FLUSH PRIVILEGES;
mysql> quit

Lets stop and start the service and connect like normal!

sudo service mysql stop
sudo service mysql start

mysql -u root
mysql >

References

https://anonscm.debian.org/cgit/pkg-mysql/mysql-5.7.git/tree/debian/NEWS?id=1025a9fa9c6c112913c59138db49dbc94891d20f