actually, that was stupid of me - you need a list of tables not files.

I think the only to do this, and the way we do it, is to run some command
like:
mysql -e"show tables in db-name like 'z%'" >tabnames

Note the use of double-quotes and single-quotes.

then use a loop to read the file "tabnames" and build a string to tack on
the mysqldump command, or issue multiple mysqldump commands.  A shell
interpreter like bash or a program like perl or php can do this easily.

You might try putting the above command in back-tics (`) and then inserting
directly into the mysqldump command.

2009/4/19 Jim Lyons <jlyons4...@gmail.com>

> try something like:
>
> mysqldump -u(user) -p (db-name) `ls z*` > (filename)
>
>
> 2009/4/19 ChoiSaehoon <saeho...@hotmail.com>
>
>
>> Is there a way to dump only specific tables starting with a certain
>> character?
>>
>>
>>
>> For example, I only want to dump tables starting with the character 'z'.
>>
>> The following doesn't work.
>>
>> mysqldump -u(user) -p (db-name) z* > (filename)
>>
>>
>>
>> Do I have to use regular expression here?
>>
>>
>>
>> Please help & thanks in advance.
>>
>> _________________________________________________________________
>> MSN 메신저의 차세대 버전, Windows Live Messenger!
>> http://windowslive.msn.co.kr/wlm/messenger/
>>
>
>
>
> --
> Jim Lyons
> Web developer / Database administrator
> http://www.weblyons.com
>



-- 
Jim Lyons
Web developer / Database administrator
http://www.weblyons.com

Reply via email to