Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

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.

share|improve this answer
add comment

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
add comment

Your Answer

 
discard

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.