mysql dump - exclude some table data and no-data -


i have big database 100 tables i'm need create dump. 98 tables data , 2 tables structure

like this

mysqldump -u root -p {--no-data db.table99,  table10 } dbname > dump.sql 

how can 1 request ?

mysqldump either includes data, or doesn't. can't 1 query.

however, can safely combine 2 mylsqdumps request 1 file on bash. first 1 excludes tables don't want has data, second 1 has 2 tables no data:

{ command1 & command2; } > new_file 

command1 => mysqldump -u root -p --ignore-table=dbname.table99 --ignore-table=dbname.table100 dbname

command2 => mysqldump --no-data -u root -p dbname table99 table100

unfortunately, you'd have supply password twice. since want 1 line, can put in bash script


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -