There was an error in this gadget

Sunday, April 18, 2010

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

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

first stop the mysql:
# service mysqld stop

enter into the mysql safe mode
# mysqld_safe --skip-grant-tables &

login as a root with no password
# mysql -uroot mysql

In mysql command prompt
> UPDATE user SET password=PASSWORD("newpassword") WHERE user="root";
> FLUSH PRIVILEGES;
> EXIT

restart the mysql
# /etc/init.d/mysqld restart

Now you can enter in to mysql using the root password "newpassword"



No comments:

Post a Comment