If you install 5.7 and don’t provide a password to the root user, it will use the auth_socket plugin
.
That plugin doesn’t care and doesn’t need a password. It just checks if the user is connecting using a UNIX socket and then compares the username.
Taken from https://dzone.com/articles/change-user-password-in-mysql-57-with-plugin-auth
So in order to to change the plugin back to mysql_native_password
:
Login with sudo:
sudo mysql -u root
Change the plugin and set a password to blank with a single command:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';
FLUSH PRIVILEGES;