(866) 366-3640 - support@sagonet.com
Sago Logo
Banner

   
Log in / create account Page Discussion History Go to the site toolbox
Resetting The Mysql Root Password

Resetting your MySQL server password

1) Login to your server via SSH

2) Stop your MySQL server with the following commands:

/etc/rc.d/init.d/mysqld stop

3) Make sure that all of the MySQL processes are actually stopped or killed.

You can check for running MySQL processes with this command:

ps aux |grep sql

If any MySQL processes are still running, kill them

kill -9 processnumber


4) Once all of the MySQL processes are killed and no longer running, you can have MySQL start without checking the permissions by executing the following command

/usr/local/mysql/bin/safe_mysqld --skip-grant-tables

  1. ctrl-Z
  2. bg

You should now be able to connect to MySQL via the MySQL client utility, using this command:

/usr/local/mysql/bin/mysql mysql

Then, execute the following command (Note: Replace YOUR_PASSWORD with your actual password.):

UPDATE user SET Password=PASSWORD('YOUR_PASSWORD') WHERE Host='localhost' AND User='root';

Then, run the command:

exit;