Skip to content

Instantly share code, notes, and snippets.

@esedic
Created February 7, 2024 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esedic/85abb69b0e41ec3ee5e6132156927b6d to your computer and use it in GitHub Desktop.
Save esedic/85abb69b0e41ec3ee5e6132156927b6d to your computer and use it in GitHub Desktop.
Change MySQL root password
sudo mysql
// get MySQL user accounts
SELECT user,authentication_string,plugin,host FROM mysql.user;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
FLUSH PRIVILEGES;
// you should see the change
SELECT user,authentication_string,plugin,host FROM mysql.user;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment