Home > mysql > ERROR 1045 (28000): Access denied for user ‘root’@'localhost’ (using password: NO)

ERROR 1045 (28000): Access denied for user ‘root’@'localhost’ (using password: NO)

February 6th, 2010

For some reason after setting up replication the root password on both master and slave were cleared. This has happened more than once. Note that i can access mysql via…

$mysql -u root -p
mysql>

Of course this is not desirable. Simply reset the password on the master and the table propegates to the slave and fixes the problem.

UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;

mysql

  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.