Resetting MySQL Root Password

The preceding sections provide password-resetting instructions for Windows and Unix systems. Alternatively, on any platform, you can set the new password using the mysql client (but this approach is less secure):

  1. Stop mysqld and restart it with the --skip-grant-tables option. This enables anyone to connect without a password and with all privileges.

  2. Connect to the mysqld server with this command:

    shell> mysql
  3. Issue the following statements in the mysql client. Replace the password with the password that you want to use.

    mysql> UPDATE mysql.user SET Password=PASSWORD('MyNewPass')
    -> WHERE User='root';
    mysql> FLUSH PRIVILEGES;

    The FLUSH statement tells the server to reload the grant tables into memory so that it notices the password change.

You should now be able to connect to the MySQL server as root using the new password. Stop the server and restart it normally (without the --skip-grant-tables option).

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Restore SSH Config via WHM

Problem login to SSH or forget your SSH port on cPanel Server, don't worry you can run this tools...

change ssh port

1. Login into your server as a root user pico -w /etc/ssh/sshd_config Find the line...

Fixing WHM problems automatically using JUPITER Tools :-D

Now you have angel hands for solving your WHM  related (selected) problems using JUPITER Tools ....

Full site backup and restore using Shell

You can generate full site backup from individual cPanel account. However, for some reason if you...

Cpanel/WHM Script List

WARNING: These scripts may not be "safe", they are mostly in perl so you can view them and check...