Reset MySQL root password Ubuntu Linux

Enter the following lines in your terminal.

First lets Stop MySQL server

sudo /etc/init.d/mysql stop

Now lets open the mysqld configuration.

sudo mysqld –skip-grant-tables &

Login to MySQL as root.
mysql -u root mysql

Replace “MYNEWPASSWORD” with your new password!

UPDATE user SET Password=PASSWORD(‘MYNEWPASSWORD’) WHERE User=’root’;    FLUSH PRIVILEGES; exit;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s