Archive

Posts Tagged ‘mysqldump’

Backup and restore a single MySQL table

mysql-backup-restore-table

Dump a single table to a SQL file:

mysqldump -uuser -ppassword dbName tableName > backup.sql

Read more…

Tips

Drop all tables in MySQL database without recreating them

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.

Tips