Backup and restore a single MySQL table
Dump a single table to a SQL file:
mysqldump -uuser -ppassword dbName tableName > backup.sql
Dump a single table to a SQL file:
mysqldump -uuser -ppassword dbName tableName > backup.sql
Use the following tip to drop all tables in a database:
mysqldump -uusername -ppassword -hhost \
--add-drop-table --no-data database | grep ^DROP | \
mysql -uusername -ppassword -hhost database
Much easier than have to drop a database, recreate it, and then grant privileges again.
Recent Comments