In the last versions of MySQL, a random password is generated, and can't be used, because it is expired.
So, a GUI like Sequel Pro won't be able to connect until you change it.
The MySQL documentation says you can connect with mysql -u root -h 127.0.0.1 -p
, and change the password by performing an ALTER
request, but in my case it didn't work, saying my temporary password was invalid.
Those steps allowed me to fix this:
Stop MySQL from the preference pane.
In the /usr/local/mysql/support-files/
directory, copy my-default.cnf
to my.cnf
.
In my.cnf
, add the following line in the [mysqld]
section:
skip-grant-tables
Then, restart MySQL.
Login in MySQL from the command-line:
mysql -u root -p
Enter password:
Enter the temporary password, this time it should work.
Then, update the root
password:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'the new password';
- Stop MySQL
- Delete the
my.cnf
file, or remove at least theskip-grant-tables
line - Restart; now the connection should be OK