Recently, I forgot the root password for MySQL and went about resetting it as below:
-
Stop mysqld and restart it with:
# service mysqld stop # mysqld_safe --skip-grant-tables --user=rootConnect to the mysqld server with this command:
sql> mysql -u rootIssue the following statements in the mysql client:
mysql> UPDATE mysql.user SET Password=PASSWORD('newpassword') WHERE User='root'; mysql> FLUSH PRIVILEGES;
Replace “newpassword
- sandip's blog
- Login or register to post comments
Comments
thanks....
it really works..
coz this command helps me to change my old password...!!!