Article ID: 4445, created on Mar 24, 2008, last review on May 10, 2014

  • Applies to:
  • Sphera


How to reset the VDS MySQL Admin Password, without using the GUI?


In order to reset MySQL admin password (root), please perform the following actions:

1. Stop MySQL

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

2. Start MySQL in the 'safe mode'

/usr/local/mysql/bin/safe_mysqld --skip-grant-tables & (Ignore the chown error message)

3. Reset 'root' password

mysqladmin -u root flush-privileges password "new_pass"

4. Restart MySQL in the normal mode

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

/etc/rc.d/init.d/mysqld start

After that you will be able to connect MySQL :

mysql -p
Enter Password: new_pass

5. Edit /etc/my.cnf file and change the line password="new_pass"

Now you can connect MySQL with no parameters.

5f478287f7e74fe9b07217d8131cd741 6311ae17c1ee52b36e68aaf4ad066387

Email subscription for changes to this article
Save as PDF