I just installed mysql 5.7.23 on my mac sierra 10.13.5.
I saved this to a notepad:
2018-09-02T05:39:56.919171Z 1 [Note] A temporary password is generated for root@localhost: =su8S7ge4d4X
If you lose this password, please consult the section How to Reset the Root Password in the MySQL reference manual.
I tried to log in using the password mysql -u root -p =su8S7ge4d4X
Got error:
Access denied for user 'root'@'localhost' (using password: YES)
Tried to change password:
Stop the mysqld server.
- Mac OSX:
System Preferences>MySQL>Stop MySQL Server
- Mac OSX:
Start the server in safe mode with privilege bypass
- From Terminal:
sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables
- From Terminal:
In a new terminal window:
sudo /usr/local/mysql/bin/mysql -u root
This will open the mysql command line. From here enter:
UPDATE mysql.user SET authentication_string=PASSWORD('NewPassword') WHERE User='root';FLUSH PRIVILEGES;quit
Stop the mysqld server again and restart it in normal mode.
- Mac OSX (From Terminal):
sudo /usr/local/mysql/support-files/mysql.server restart
- Mac OSX (From Terminal):
It doesn't look like any rows are being affected:
mysql> UPDATE mysql.user SET authentication_string=PASSWORD('root') WHERE User='root';
Query OK, 0 rows affected, 1 warning (0.01 sec)
Rows matched: 1 Changed: 0 Warnings: 1
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
Still tired to login:
Access denied for user 'root'@'localhost' (using password: YES)
I have no idea what to do at this point.