mysqldump --ignore-table

mysqldump --ignore-table

am 08.06.2011 09:06:58 von zia mohaddes

--485b3979da84de4b6a04a52dfd62
Content-Type: text/plain; charset=ISO-8859-1

Dear all,

I am currently trying to figure-out how I could ignore multiple tables in
mysql using a simple a regex. For example I have multiple tables which have
the following structure: mytable1, mytable2, ..........,mytable100. And I
would like these tables to be ignore when doing mysqldump by doing something
like this:
mysqldump --ignore-table = mydb.table*

I am wondering if there is any way do something like this in mysql!


Thank you kindly for the help,
regards,
daniel

--485b3979da84de4b6a04a52dfd62--

Re: mysqldump --ignore-table

am 08.06.2011 10:31:29 von Claudio Nanni - TomTom

--20cf3054ab59c326c604a52f2992
Content-Type: text/plain; charset=ISO-8859-1

Hi Daniel,

you can use a workaround from the shell,

cd /path/to/your/database (e.g.: cd /var/lib/mysql/mydb)

ls -al *table** | awk '{print $8}' | awk -F"." '{print "--ignore-table=*mydb
*."$1}' | xargs mysqldump -u*root* -p*toor* *--your-flags **mydb*

It's not that beautiful but it should work.

Claudio

2011/6/8 zia mohaddes

> Dear all,
>
> I am currently trying to figure-out how I could ignore multiple tables in
> mysql using a simple a regex. For example I have multiple tables which have
> the following structure: mytable1, mytable2, ..........,mytable100. And I
> would like these tables to be ignore when doing mysqldump by doing
> something
> like this:
> mysqldump --ignore-table = mydb.table*
>
> I am wondering if there is any way do something like this in mysql!
>
>
> Thank you kindly for the help,
> regards,
> daniel
>



--
Claudio

--20cf3054ab59c326c604a52f2992--