User Tools

Site Tools


mysqldump

**This is an old revision of the document!**

mysqldump -uroot -p -f --add-locks --comments --create-options --disable-keys --dump-date --extended-insert\
 --log-error=/var/log/mariadb/dump/latest/dump.log --max-allowed-packet=16M --replace --routines --triggers\
 --tab=/var/log/mariadb/dump/latest\
 --ignore-table=sprar_20200512_prod0.audit_user\
 sprar_20200512_prod0 > /var/log/mariadb/dump/latest/routines.sql
mysqldump -uroot -p --add-locks --comments --create-options --disable-keys --dump-date --extended-insert\
 --max-allowed-packet=16M --replace --routines --triggers --tab=/var/log/mariadb/dump/latest\
 --where="1 limit 100" sprar_20200512_prod0 audit_user
mysql -uroot -p INFORMATION_SCHEMA --skip-column-names --batch\
 -e "select table_name from tables where table_type = 'VIEW' and table_schema = 'sprar_20200512_prod0'"\
 | xargs mysqldump -uroot -p -f sprar_20200512_prod0 > /var/log/mariadb/dump/latest/views.sql

Sauce

mysqldump.1594026859.txt.gz · Last modified: 2020/07/06 11:14 by valerio