Isaac Sloan - Logging into mysql -u root with non root user on Mysql 5.7
Banner700

Logging into mysql -u root with non root user on Mysql 5.7

When you upgrade from Mysql 5.6 to 5.7 you will no longer be able to log into mysql's root user without root access.

This is annoying if you're using it for development as most frameworks assume the development database can be connected to via root user with no password.

This solution is to change the login plugin back to native_password.

  1. Use sudo to login:

    sudo mysql -u root

  2. Change login plugin:

    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';

Now mysql -u root should work. Enjoy!

November 30, 2017
ubuntumysql
comments powered by Disqus