Following is a way to reset MySQL root password when you forgot.
- Stop MySQL: /etc/init.d/mysqld stop
- Startup MySQL without password prompt: mysqld_safe --skip-grant-tables &
- Login to MySQL: mysql --user=root mysql
- Reset password: mysql> update user set Password=PASSWORD('new-password') where user='root';
- mysql> flush privileges;
- mysql> exit;
- Kill running mysql daemon: kill mysql-pid
- Start MySQL: /etc/init.d/mysqld start
No comments:
Post a Comment