Reset mysql password on linux

Simply change or reset your MySQL root password by doing the following:

  1. Stop the MySQL server

    sudo service mysql stop

  2. Start mysqld

    sudo mysqld --skip-grant-tables &

  3. Login to MySQL as root

    mysql -u root mysql

  4. Change MYSECRET with your new root password

    UPDATE user SET Password=PASSWORD('MYSECRET') WHERE User='root'; FLUSH PRIVILEGES; exit;

  5. Kill mysqld

    sudo pkill mysqld

  6. Start mysql

    sudo service mysql start

  7. Login to phpmyadmin as root with your new password
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