User:Kelson/Memo
Jump to navigation
Jump to search
MySQL
# Get table list with prefix
mysql -N information_schema -ufoouser -pfoopass -e "SELECT table_name FROM tables where table_schema='foodb' AND table_name like 'prefix_%'" > tables.txt
# Dump only a subselection of table in a DB
mysqldump -ufoouser -pfoopass dbname `cat tables.txt` | xz > dbname.sql.xz
# Dump DB without triggers
mysqldump --skip-triggers -ufoouser -pfoopass foobar | xz > foobar.notriggers.sql.xz
# Dump only trigger
mysqldump --no-create-info --no-create-db --skip-opt --no-data -ufoouser -pfoopass foobar | xz > foobar.trigers.sql.xz