Change the Root Password on Mac OS 10.10

There is a small change to the way to update the root password for MySQL in Mac OS 10.10.

If you do not have a root password already, then log into mysql like this (otherwise use your password):

$> mysql -u root

Then tell mysql you want to ‘use’ the mysql database.

Before version MySQL 5.7 , the updating the root password looked like this:

mysql> USE mysql;
mysql> UPDATE user SET password=PASSWORD("NEWPASSWORD") WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> quit

As of version MySQL 5.7 the ‘password’ column is renamed to ‘authentication_string’.

The proceedure looks like this:

mysql> USE mysql;
mysql> UPDATE user SET authentication_string=PASSWORD("NEWPASSWORD") WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> quit

Leave a Reply

Your email address will not be published.