|
|
abukta
super admin
profile |
|
Join Date: 29 Mar 2005 21:03
Posts: |
|
|
Recovering / Changing Your MySQL Root Password |
Sometimes you may have to recover the MySQL root password because it was either forgotten or misplaced. The steps you need are:
1. Stop MySQL
[root@idoumo tmp]# service mysqld stop
Stopping MySQL: [ OK ]
[root@idoumo tmp]#
2. Start MySQL in Safe mode with the safe_mysqld command and tell it not to read the grant tables with all the MySQL database passwords.
[root@idoumo tmp]# safe_mysqld --skip-grant-tables &
[1] 4815
[root@idoumo tmp]# Starting mysqld daemon with databases from /var/lib/mysql
[root@idoumo tmp]#
3. Use the mysqladmin command to reset the root password. In this case, you are setting it to ack33nsaltf1sh.
[root@idoumo tmp]# mysqladmin -u root flush-privileges \\
password "ack33nsaltf1sh"
[root@idoumo tmp]#
4. Restart MySQL normally.
[root@idoumo tmp]# service mysqld restart
Stopping MySQL: 040517 09:39:38 mysqld ended
[ OK ]
Starting MySQL: [ OK ]
[1]+ Done safe_mysqld --skip-grant-tables
[root@idoumo tmp]#
The MySQL root user will now be able to manage MySQL using this new password.
message edited by abukta (20 Jan 2006 14:27)
|