:: MArX'' Frustrated communist, card-carrying geek.

13Feb/120

Recovering MySQL access

Okay, let's say you didn't have your coffe this morning, and because of  this 'lack-of-fuel' you messed the 'mysql' database (specially users table'. All your clients are complaining, because they are not able to connect anymore, your phone rings like a hell.

Think fast! 1 shutdown your mysql server, 2 bring it up without grant handling and no network, 3 restore your last backup (I really hope you have a backup), 4 shutdown the server again, 5 start the service as usual.

in another words,

1 kill the pid of mysqld (or mysqld-nt.exe) (since mysqladmin won't work)
2 mysqld (or mysqld-nt.exe) --skip-grant-tables --skip-network
3 mysql -u root mysql < your_last_mysql_backup.sql
4 mysqladmin shutdown
5 start your mysql server as usual

If it worked, you are safe. Go get your coffee man!

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

(required)

 

No trackbacks yet.