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?

link|improve this question

50% accept rate
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
feedback

2 Answers

up vote 1 down vote accepted

Reinstall MySQL.

Here's an sql dump from my mysql table: http://www.box.net/shared/js92gum4gh.

link|improve this answer
feedback

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.

link|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
feedback

Your Answer

 
or
required, but never shown

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