DelphiFAQ Home Search:

Restoring the mysql system user table


comments3 comments. Current rating: 3 stars (1 votes). Leave comments and/ or rate it.

In our work place someone had by accident deleted the entries in mysql's user table (including 'root').
This 'user' table is a table in the system database, which you can select with the command 'use mysql'.

Without a login I could not add other entries nor do anything with standard mysql tools (except reinstall).

Good thing is we had a backup of the files that hold these tables. Note: Not a db backup with insert statements, but a file level backup of mysql's files.

In our (Linux) installation, all mysql databases are held under


The system db is under


The user table is stored as 3 files


I restored these 3 files and had to set the owner and the group to mysql, then it worked fine. Of course I had to shut down and restart the mysql daemon to make the restore take effect.


2012-11-12, 02:58:37
anonymous from United Kingdom  
2013-02-05, 01:44:33
baxlcw <a href=' '>order discount viagra</a> =-] <a href=' '>order cialis</a> qnKVN
2014-12-16, 23:09:14
anonymous from Venezuela  
I precisely wtnaed to thank you so much yet again. I am not sure the things I could possibly have made to happen in the absence of these solutions provided by you regarding such field. It has been an absolute daunting setting in my opinion, however , understanding this well-written technique you treated the issue forced me to leap over contentment. Now i am grateful for your help and in addition sincerely hope you comprehend what an amazing job you're putting in instructing most people through your webblog. Probably you haven't got to know any of us.



NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: