Help Health Professionals Fight Against COVID-19 by donating to WHO at covid19responsefund.org. We will donate 100% of our ad revenues. If you cannot donate please share with your network. Thank you for Humanity
How to reset MySQL root password ?
This page will help you to reset the root password of MYSQL database
Reset the Root Password
Remember: if you have never assigned a root password for MySQL, the server does not require a password at all for connecting as root.
However, this is completely insecure !
I don't know / I forgot the root password - Other systems
On any platform, you can reset the password using the mysql client :
Stop the MySQL server if necessary, then restart it with the --skip-grant-tables option. This enables anyone to connect without a password and with all privileges, and disables account-management statements such as SET PASSWORD. Because this is insecure, you might want to use --skip-grant-tables in conjunction with --skip-networking to prevent remote clients from connecting.
Connect to the MySQL server using the mysql client; no password is necessary because the server was started with --skip-grant-tables:
In the mysql client, tell the server to reload the grant tables so that account-management statements work:
mysql> FLUSH PRIVILEGES;
Then change the 'root'@'localhost' account password. Replace the password with the password that you want to use. To change the password for a root account with a different host name part, modify the instructions to use that host name.
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');
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 and --skip-networking options).