Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For whatever reason, the "mysql" database on my windows mysql installation has been deleted. I now have a mysql install that cannot start because the system database is missing, but I cannot find any documentation on recreating this database.

How do I recreate the mysql database (with users) on Windows?

share|improve this question
Hehe..."whatever reason". Good way to cover your tracks there, wouldn't want to admit you accidentally the whole database. – davr Oct 21 '09 at 18:13
up vote 1 down vote accepted

Reinstall MySQL.

Here's an sql dump from my mysql table:

share|improve this answer

On Unix, you would move your existing database data directory out of the way and run mysql_install_db. Unfortunately, according to the MySQL documentation, you don't have this command on Windows. It claims it is unnecessary because Windows distributions include preinitialized mysql and test databases. This would seem to suggest that you do need to reinstall MySQL.

share|improve this answer
If you are on Windows 7 don't forget to delete the folder C:\ProgramData\MySQL after deinstallation - usually it contains the database. If you don't delete it, the database will not be recreated upon installation! Instead you will end up with the old database. – Robert Sep 1 '11 at 14:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.