Christian Mayer's Weblog

MySQL Dump

All Databases

$ mysqldump -u USER -pPASSWORD -A > all.sql

Only database1

$ mysqldump -u USER -pPASSWORD database1 > database1.sql

Only table1 from database1

$ mysqldump -u USER -pPASSWORD database1 table1 > database1.table1.sql

Structure only from database1

$ mysqldump -d -u USER -pPASSWORD database1 > database1.struct.sql

Data only from database1

$ mysqldump -n -t -c -u USER -pPASSWORD database1 > database1.data.sql

Notice that there is no space (“ “) between the -p and the PASSWORD.

Posted on .
Categories: Productivity
Tags: SQL, MySQL, Dump, Backup, MySQLDump, MySQLBackkup, MySQL Dump, MySQL Backup, Database, Table, HOWTO

Imprint | Usage | Categories | RSS Feed
Copyright © 2006 by