Solutions Log

So I only have to figure things out once.

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)

Comments