Have you tried MySQLTuner yet? It's free and it makes optimizing your MySQL server easier than ever!

If you’ve forgotten the root password for a MySQL server, but you know the system root, you can reset the MySQL root password pretty easily. Just remember to work quickly since the server is wide open until you finish working.

First, add skip-grant-tables to the [mysqld] section of /etc/my.cnf and restart the MySQL server.

Next, run mysql from the command line and use the following SQL statement:

UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';
FLUSH PRIVILEGES;

Remove the skip-grant-tables from /etc/my.cnf and leave the server running. There’s no need to restart it.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis
Leave a Reply

You must be logged in to post a comment. Login »