NEVER type DROP DATABASE mysql;

jdavidb on 2008-03-14T15:38:34

Just don't. It will not be fun. It will be painful. "Pleasant" is not a word you will use to describe the experience.

I kinda tried to keep going hoping that maybe the mysqld server wouldn't notice, or that it would just drop the database I meant to drop instead, but it was too smart for me. Moreover, next I noticed I couldn't restore another database from a dump. And I couldn't even restore my mysql database from a dump off of another user's machine. mysqldumps are intricately tied into that particular database, no matter which database you're backing up and restoring.

So then I realized I'd better back up the one other database that mattered and totally reinstall the server, but of course mysqldump wouldn't work. sigh. :)

Update: Other database (my notes wiki) lost forever. Don't just back up /var/lib/mysql/dbname; you have to back up other files as well. Sigh.


MyISAM

phillup on 2008-03-14T18:33:06

Hopefully you haven't done anything drastic yet...

The MySQL database is made up of MyISAM tables.

And, you *should* be able to copy that folder from another install and then restart MySQL. (correct version, of course)

However, you will most likely need to start MySQL with --skip-grant-tables.

That should get you running well enough to dump everything safely and reinstall.

HTH

Re:MyISAM

jdavidb on 2008-03-14T21:11:25

Thank you. Unfortunately, I've already done something drastic, and it was not the right thing. :(

Expensive lesson learned. :)