Young Webmaster Camp 8
15
Oct

Recover MySQL Database root password

Ploblem: forget MySQL root password
Solutions: Recover(Hack) Mysql root password

1. Login as root
2. Stop the MySQL server by using command

/etc/init.d/mysql stop
#ps aux | grep mysql
#kill -9 mysqlID

3. Start MySQL server without password

mysqld_safe --skip-grant-tables &
#/usr/local/mysql/bin/mysqld_safe --skip-grant-tables &

4.Connect to mysql server using mysql client

mysql -u root

5. Now you need to Setup new MySQL root user password

mysql> use mysql;
mysql> update user set password=PASSWORD("newrootpassword") where user='root';
mysql> flush privileges;
mysql> quit

6. Restart MySQL

/etc/init.d/mysql stop
/etc/init.d/mysql start

good luck ;)

URL:http://www.taxze.com/recover-mysql-database-root-password.htm

, , , ,

Leave a Reply “Recover MySQL Database root password”