Monday 5 March 2012

[SLOVED] reset MySQL Password

Sometime you face a problem look like:
ERROR 1045: Access denied for user: 'root@localhost' (Using 
password: NO)
or 
ERROR 1045: Access denied for user: 'root@localhost' (Using 
password: YES) 
 Hence, you should reset your mysqld password just follow these instructions :
stop mysql demon: sudo /etc/init.d/mysql stop
Start the mysqld demon process:
sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &
After that, type these commands:
mysql -u root
FLUSH PRIVILEGES;
UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';
FLUSH PRIVILEGES;
Anyway, stop mysqld and relaunch mysql by;
sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql start

No comments:

Post a Comment