Reset MySQL root password

From Organic Design wiki
Revision as of 02:04, 14 March 2009 by Nad (talk | contribs) (Created page with '{{procedure |status = In use |role = sysop }} To reset the root password of a MySQL server, first go to a root shell and stop MySQL: {{code|<pre> /etc/init.d/mysql stop </pre>}} ...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Procedure.svg Reset MySQL root password
Organic Design procedure

To reset the root password of a MySQL server, first go to a root shell and stop MySQL:

/etc/init.d/mysql stop


Next, run MySQL in safe mode in the background:

/usr/local/mysql/bin/safe_mysqld --user=mysql --skip-grant-tables --skip-networking &


Reset the MySQL root password:

/usr/local/mysql/bin/mysqladmin -u root flush-privileges password "******"


And restart the MySQL server again:

/etc/init.d/mysql restart