CartMetrix - Do you know yours?

« Consternation | Home | Backup Your Data »

9/6/2005

Reset Root MySQL Password

1. Gracefully stop the MySQL server. On most Linux systems:

/etc/init.d/mysql stop

2. Restart mysqld with the --skip-grant-tables option.

safe_mysqld --skip-grant-tables

3. Set a new password with the mysqladmin password command.

mysqladmin -u root password 'newpassword'

4. Now stop mysqld and restart it normally.

/etc/init.d/mysql restart

5. After this, you should be able to connect using the new password.

Alternatively, you can set the new password using the MySQL client:

1. Repeat steps 1 and 2 above.

2. Connect to the mysqld server with:

mysql -u root mysql

3. Issue the following commands in the MySQL client:

UPDATE user SET Password=PASSWORD('newpassword') WHERE User='root';

4. Exit out of the MySQL client and restart the server as above.

5. You can now stop mysqld and restart it normally.

Popularity: 15%

Trackback:

Related Posts

Post your opinion

Verification Image

Please type the letters you see in the picture.

Subscribe without commenting


damonparker.org is proudly powered by WordPress
Entries (RSS) and Comments (RSS).

copyright © 2002-2009 damonparker.org. all rights reserved.

Close
E-mail It