Skip to content

Instantly share code, notes, and snippets.

@rcapile
Last active August 9, 2018 19:58
Show Gist options
  • Save rcapile/90ec051af1b76f32984293f61fecb53f to your computer and use it in GitHub Desktop.
Save rcapile/90ec051af1b76f32984293f61fecb53f to your computer and use it in GitHub Desktop.
Mysql 5.7 Install

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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment