Home     Blog

How to Reset a MySQL Password

A MySQL password can be reset in 5 easy steps:

  1. Stop the mysqld daemon process.
  2. Start the mysqld daemon process with the –skip-grant-tables option.
  3. Start the mysql client with the -u root option.
  4. Execute the UPDATE mysql.user SET Password=PASSWORD(‘password’) WHERE User=’root’;
  5. Execute the FLUSH PRIVILEGES; command.

These steps reset the password for the “root” account to “password.” To change the password for a different account or to set a different password, just edit the variables in single quotes in step 4.reset mysql password How to Reset a MySQL Password

If the user knows his/her existing MySQL root password, steps 1-3 are not necessary.

VN:F [1.9.17_1161]
Rating: 10.0/10 (3 votes cast)
How to Reset a MySQL Password, 10.0 out of 10 based on 3 ratings
Follow Will.Spencer on

Comments (8)

 

  1. Abdullah Ramadan says:

    very useful

    VN:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  2. elrando says:

    8) Thank you very much, I finally can login to my phpmyadmin. Thank you for blessing the internet with actual real and useful information.

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  3. john says:

    Hi i would like to know how to make my mysql console stop asking for password.When i installed mysql firsttime i could login directly without a password.I do know my current password but would like to go back to as it were.
    Thanks in advance!

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  4. andrei says:

    It doesn’t work, nothing happens after I type UPDATE mysql.user SET Password=PASSWORD(‘password’) WHERE User=’root’; My console changes from ‘mysql>’ to ‘`>’ and that’s all.

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
    • andrei says:

      You might have a syntax error in the command at step 4, it should be

      UPDATE mysql.user SET Password=PASSWORD(“password”) WHERE User=”root”;
      This works for me. Cheers ;)

      VA:F [1.9.17_1161]
      Rating: 0.0/5 (0 votes cast)
  5. andrei says:

    I mean, there should be double-quotes instead of single-quotes, seems like my command line makes a difference on this…

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
    • memenode says:

      I’m guessing either will be fine depending on context. Did single quotes work for anyone else?

      VN:F [1.9.17_1161]
      Rating: 0.0/5 (0 votes cast)
  6. vinyll says:

    Correct single quotes work, but not the one used in the blog post. This works indeed (regular single quotes here) :

    UPDATE mysql.user SET Password=PASSWORD(‘password’) WHERE User=’root’; FLUSH PRIVILEGES;

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)

Leave a Reply

Related Posts

  • How to Reset a Mac OS X System Administrator (root) Password

    Warning: Unless deliberately changed, the keychain password is bound to the original administrator password. This originally provided single sign-on capabilities. Using the following method to reset one’s administrator password will require additional steps to also reset the keychain password. Please be advised that this may mean deleting any keychain protected with one’s original administrator password. [...]...


  • How to Reset a Mac OS X Keychain Password

    A default keychain binds to an Administrator password upon creation and will continue to update when the Administrator password is updated via the Accounts menu. When someone forgets his/her password and is forced to utilize other means to reset it (See FAQ entitled: How do I reset a Mac OS X System Administrator (root) Password?), [...]...


  • How to Reset an Acer BIOS Password

    If the user can boot the Acer, he/she may be able to reset the BIOS password using Acer eSettings Management. Click the Start button Click the All Programs menu item Click the Empowering Technology menu item Click the Acer eSettings Management menu item Once inside Acer eSettings Management, click the Security button. Sending a Computer [...]...


  • How to Reset a Dell BIOS Password

    Dell Dimension BIOS Password Recovery The BIOS password may be cleared from a Dell Dimension by moving the password jumper on the motherboard. The password jumper’s location on a Dell Dimension motherboard can be found by reviewing the Dimension User Guides. For most Dell Dimension desktops, the steps to reset a BIOS password and clear [...]...


  • Reset IBM ThinkPad BIOS Password

    An IBM ThinkPad laptop can have three hardware password sets: Power-On Password Hard Disk Password Supervisor Password Power-On Password RT/CMOS RAM has 8 bytes reserved for the power-on password and the check character. The 8 bytes are initialized to hex 00. The microprocessor can access these bytes only during POST. After POST is completed, if [...]...