Jump to content

Expired MySQL 5.7 Password reset


Raymond Geerts
 Share

Recommended Posts

After doing a fresh install of MySQL 5.7 on macOS High Sierra, the installer generates a temporary password for the root user. The problem is as soon the installer is finished, the given root password is already expired. Resulting in not being able to login as root to MySQL.

It took me a while of reading, fiddling around, and trying all kinds of tips and examples on how to reset the root password.

The following worked for me. And in the hope it an help somebody else, and for backup purposes, I'll leave it here.

Open the following folder in a Terminal window:

/usr/local/mysql/bin

Type in (copy + paste) the following commands, where `xxxxxxxx` is the desired root password:

./mysql -u root -p --connect-expired-password

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('xxxxxxxx');

UPDATE user SET authentication_string='xxxxxxxx' WHERE User='root'

The last line with the UPDATE command was necessary for me to finish the process.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...