Here is the process of retrieving a lost mysql root password:
- Stop the MySQL server process.
# /etc/init.d/mysql stop
- Start the MySQL (mysqld) server/daemon process with the –skip-grant-tables option so that it will not prompt for password
# mysqld_safe --skip-grant-tables &
- Connect to mysql server as the root user
# mysql -u root
- Setup new root password
mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
- Exit and restart MySQL server
# killall mysqld
# /etc/init.d/mysql start
No comments:
Post a Comment