MySQL :: Reset Lost Root Password
December 8th, 2008This is a quick and easy 5 step procedure to reset a lost MySQL password.
First off we need to Kill the mysqld that may be running (not with -9)
(in FreeBSD /usr/local/etc/rc.d/mysql-server stop)
Step 1:
Start MySQL in safe mode.
/usr/local/bin/safe_mysqld –skip-grant-tables &
Step 2:
Start the MySQL Client
/usr/local/mysql
Step 3:
Edit the root password held within the mysql database.
Type the following commands:
use mysql;
update user set password = password(’…….’) where user = ‘root’ and host=’localhost’;
Step 4:
Stop mysql from command line with the following command:
mysqladmin -u root -p shutdown
Step 5:
Start mysqld again:
(in FreeBSD /usr/local/etc/rc.d/mysql-server start)