|  About Me  |  Blogs  |  Photos  |  Publications  |  Resume  | 

Reset MySQL password

Here’s how to reset the forgotten root password for mysql,

$ sudo su
$ /etc/init.d/mysql stop
$ mysqld --skip-grant-tables
$ mysql -u root mysql
mysql>UPDATE user SET Password=PASSWORD('newpwd') WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql>quit
$ /etc/init.d/mysql start

2 Responses to “Reset MySQL password”

  1. Andrew Thornton Says:

    Thank you so much. I was getting tired of trying to divine the correct way to get this thing working.

  2. DaeO Says:

    Thanks…

Leave a Reply

You must be logged in to post a comment.