I had to install a couple of dbs on a mysql server which refused to recognize me as its root… I kept receiving the following not-so-friendly message:
Stop the service:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)As it turns out, something was messed up during the installation and mysql did not recognize the given root password (mistype perhaps?). Anyway, I had to reset the pass, and this is how I did it.
Stop the service:
sudo service mysql stopStart on safe mode without permissions check:
sudo mysqld_safe --skip-grant-tables &Login as root on mysql:
mysql -u rootUpdate the root user’s password in the corresponding table:
mysql> use mysql;And then restart the mysql service...
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
No comments:
Post a Comment