Recovering the MySQL root password
Page 1 of 1
Recovering the MySQL root password
If you are unable to recall the password for MySQL root account you will need to reset it. Remember that by default MySQL root account has an empty password so try that first.
Login as root to the machine with the MySQL server (not to MySQL).
Stop the MySQL server by using either of the following command:
- Code:
$ /etc/init.d/mysql stop
Now the MySQL server must be started so that it does not take user credentials into account:
- Code:
$ <code>mysqld_safe --skip-grant-tables &</code>
Once MySQL has been started in this manner you (and anyone else who has access to this machine so be aware of inherent danger here!) can simply connect as root user without
password:
- Code:
$ mysql -u root
Now simply change the root password and force MySQL server to take it into account:
- Code:
mysql> use mysql;
mysql> update user set password=PASSWORD(“rootPassOfYoutChoice”) where user=’root’;
mysql> flush privileges;
mysql> quit
Once root password is changed we need to restart MySQL server because right now it is not taking user credentials into account:
- Code:
$ /etc/init.d/mysql restart
After this point MySQL server will operate just as before with the root account having the new password.
andry- Moderator
- Posts : 467
Join date : 2010-05-07
Similar topics
» Possible new MySQL 0day
» FreeBSD <= 6.1 Local Root Vulnerability
» FreeBSD 8.0 local root exploit
» Linux 2.6.x fs/pipe.c local root exploit
» FreeBSD 7.2 local root vulnerability (0day) demo
» FreeBSD <= 6.1 Local Root Vulnerability
» FreeBSD 8.0 local root exploit
» Linux 2.6.x fs/pipe.c local root exploit
» FreeBSD 7.2 local root vulnerability (0day) demo
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|