This is a bad idea and should only be used as a last resort.
Restore MySQL databases from a hard drive backup
Drag everything from /usr/local/mysql/data into the same location on the new installation, overwriting whatever is there. You may have to chown the folder from mysql to your user name, just don’t forget to chown it back or it won’t start up again.
No dumps needed.
I hope this will show up in a Google search for “restore mysql databases "without dump"“
Comments
I’ve read that if you make backup copies of your MySQL data files while the MySQL server is running, there will be errors in your backup copies. Use dumps when possible.
Always use dumps, if you’re using InnoDB tables you’ll be in a world of hurt if you try to back up this way. And I only know this from experience, heh.
MyISAM might be able to back up this way but InnoDB uses a keyed table of some sort that somehow is married to your machine/install or SOMETHING. I’m no expert, i just know i was screwed by backing up this way.
For the record, Rails migrations will create InnoDB tables by default. And if you need DB transactions, InnoDB is your only choice. MyISAM tables do not support transactions.
The reason I needed to do this was that I was recovering from a hard drive crash. I would normally use dumps. I haven’t noticed anything awry after doing this, but I know it’s a bad idea.
What do you think about that?