MySQL Commands You Should Have Committed to Memory Already
Dump the database
mysqldump -h database_host -uUsername -p database_name > dump.sql
Restore from the dump
If you need to create the database first:
mysqladmin -h database_host -uUsername -p create database_name
Then load the SQL file:
mysql -h database_host -uUsername -p database_name < dump.sql
Source
Build Your Own Database Driven Website Using PHP & MySQL, 2nd Edition (Page 133)
Restoring keychain passwords (including Transmit) from a hard drive backup
This worked for me:
- Rename the file
~/Library/Keychains/login.keychain(to keep it safe just in case) - Drag your backup copy of
login.keychainto the same location - Make sure your admin account on your new system (or install of OS X) has the same password as the old one, or (according to JTJ) it won’t automatically open it when you log in.
Source: Originally tweeted.
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"“