Ajour exclure VIEWS mysqldump
This commit is contained in:
parent
bfe99f5386
commit
85d2ffafd9
|
@ -874,6 +874,14 @@ Et pour sauvegarder des tables correspondant à un motif (préfixe le plus souve
|
||||||
$ mysqldump --hex-blob foo $(mysql foo -B --column-names=False -e "show tables like 'exemple_%'") > foo_motif.sql
|
$ mysqldump --hex-blob foo $(mysql foo -B --column-names=False -e "show tables like 'exemple_%'") > foo_motif.sql
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
Pour exclure les VIEWS d'un mysqldump :
|
||||||
|
|
||||||
|
~~~
|
||||||
|
EXCLUDE_VIEWS=$(echo "SELECT TABLE_SCHEMA, TABLE_NAME from INFORMATION_SCHEMA.VIEWS" | mysql information_schema | sed '/^TABLE_SCHEMA/d' | gawk {'print $1"." $2'} |tr '\n' ',')
|
||||||
|
|
||||||
|
mysqldump --opt --all-databases --force --ignore-table=$EXCLUDE_VIEWS --events --hex-blob > foo.sql
|
||||||
|
~~~
|
||||||
|
|
||||||
Pour dumper avec une condition particulière :
|
Pour dumper avec une condition particulière :
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
|
|
Loading…
Reference in a new issue