Log in Go to the main page Page Discussion History Go to the file list Go to the site toolbox

MySQL Password Recovery

From RZWiki


Error creating thumbnail:
(process:20118): libgnomevfs-WARNING **: Unable to create ~/.gnome2 directory: Permission denied
convert: unable to open image `/home/routerzone/httpdocs/wiki/images/5/51/Mysql.svg': No such file or directory.
convert: missing an image filename `PNG:/home/routerzone/httpdocs/wiki/images/thumb/5/51/Mysql.svg/48px-Mysql.svg.png'.

The following details the basic procedure for performing password recovery for MySQL running on a Linux platform;

  • Stop the MySQL deamon: /etc/init.d/mysqld stop
  • Start the MySQL deamon without user privilege enforcement and thus, for security reasons, any networking functions: /etc/init.d/mysqld start --skip-grant-tables --skip-networking
  • Change the account password as required, the root account is used in this example:
  • mysql -u root
  • mysql>SET PASSWORD FOR root@'localhost' = PASSWORD('new_password');
  • mysql>UPDATE mysql.user SET Password=PASSWORD('new_password') WHERE User='root';
  • mysql>FLUSH PRIVILEGES;
  • mysql>exit
  • Stop the MySQL deamon again: /etc/init.d/mysqld stop
  • Start the MySQL deamon as normal: /etc/init.d/mysqld start

Accessories-text-editor-v2-medium.png Usage Notes

The UPDATE command is only necessary if you have a MySQL account that can connect from 'everywhere'

Icemon-medium.png Related Articles

See our other Password Recovery articles

See our other MySQL articles

Information on Linux commands Tux-small.png

Information on F5 BigIP commands F5-logo-small.png

Information on Cisco commands Cisco-logo-small.png

Information on Vyatta commands Vyatta-logo-small.png

Information on Extreme commands Extreme-logo-small.png

Information on Zebra commands

Information on Secure Platform commands

Information on Blue Coat SGOS commands

Information on Nokia IPSO commands


Internet-group-chat-small.png We really do appreciate all feedback so please do send your comments, suggestions or corrections to sjiveson#routerzone.eu
(replacing the # with an @)


Site Toolbox:

Personal tools
This page was last modified on 18 November 2008, at 18:02. - Disclaimers - About Network Stuff
Powered by MediaWiki