In Linux, the default MySQL grant tables can be created with the mysql_install_db
script, but that does not work on Windows.
How can the default grant tables be installed on Windows?
(No, I’m not looking for the response that Google’s results are packed full of about how they are automatically installed on Windows, because that is only the case with the installer distribution, not the ZIP package. Besides, that does not help after MySQL is installed and the data directory is damaged or is being replaced or such.)
Best Answer
I knew I had faced this before and managed to figure it out, so I searched my drives and found a batch file I had written last time.
For anyone else who experiences this issue, what you need to do is to run the server daemon with the
--bootstrap
parameters.Here is the script I used to dump all the databases out to an SQL file and re-import them (that is, manually—and inconveniently—implementing a MySQL counterpart to SQLite’s
vacuum
command).