mysqldump syntax - dumping only specific tables starting with a certain character. (e.g. z*)

2009-04-19 Thread ChoiSaehoon

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/

Re: mysqldump syntax - dumping only specific tables starting with a certain character. (e.g. z*)

2009-04-19 Thread Jim Lyons
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


RE: mysqldump syntax - dumping only specific tables starting with a certain character. (e.g. z*)

2009-04-19 Thread ChoiSaehoon

I tried it, then it gives the following error message
 
mysqldump: Can't get CREATE TABLE for table 'ls z*' (Table '(db-name).ls z*' 
doesn't exist)
 
What does 'ls' mean? (as in linux command 'ls'?)
 
:)

 
 Date: Sun, 19 Apr 2009 08:53:36 -0500
 Subject: Re: mysqldump syntax - dumping only specific tables starting with a 
 certain character. (e.g. z*)
 From: jlyons4...@gmail.com
 To: saeho...@hotmail.com
 CC: mysql@lists.mysql.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

_
강력해진 보안성, 아웃룩을 닮아 편리해진 기능들로 무장한 Windows Live Hotmail! 지금 로그인해 보세요!
http://www.hotmail.com

Re: mysqldump syntax - dumping only specific tables starting with a certain character. (e.g. z*)

2009-04-19 Thread Uwe Kiewel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

ChoiSaehoon schrieb:
 I tried it, then it gives the following error message
  
 mysqldump: Can't get CREATE TABLE for table 'ls z*' (Table '(db-name).ls z*' 
 doesn't exist)
  
 What does 'ls' mean? (as in linux command 'ls'?)

you have to use the ` sign, not the '

Uwe



  
 :)
 
  
 Date: Sun, 19 Apr 2009 08:53:36 -0500
 Subject: Re: mysqldump syntax - dumping only specific tables starting with a 
 certain character. (e.g. z*)
 From: jlyons4...@gmail.com
 To: saeho...@hotmail.com
 CC: mysql@lists.mysql.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
 
 _
 강력해진 보안성, 아웃룩을 닮아 편리해진 기능들로 무장한 Windows Live Hotmail! 지금 로그인해 보세요!
 http://www.hotmail.com

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIVAwUBSes1W0JXG7BUuynnAQJWExAAuzKonpnWPeynnFyvodfGYSP1p9A5ybC6
Azi0j4iGk237HlJ8I8OKh+aBsQGnykzGEQ5eE4xAAaL7bocFlYjHkvaIAhqxzg7c
/ZaS9j8k+sGrteAsiA1y8fTj4L3uzLJP+0+crm1yKGKO8Jl9BKxqWl+x3Di6XMYF
1R8OdgBDY1mClUZEqbbBtm0pOs6N/SGcLGyiZNH5xEyRrnXbrh24WY0OQov5pDPj
T2G0vC2GpZOZEN1qQeJp5G2ZZ+8gPvZhW+cMElvLNVF3aWkWyd/hEFIxG0cBZ/cR
afcreK3AcnAP80ng8150cFN+y5nMR5GExqPDx1j91s9zdW7poMjZiRZKjAOMSqJv
Aj+m/MitxGECTOIrCiYo9kP5CyzT6LIng9jyqiNCNR3L2T4sx/LgpLvap+ynwsmz
kbqBaLcuPwzCW2f5eIYsfrh5lJMoF86GjTshbFnXXk/EN4etcjTTuFJMiNqPjqvy
jonw0b1S17qHRJJPSfLvgk0NEWOB6tYQQuVcWyZyEb0TamfHP04Vdbe9NIKexU04
gafSM5pOBed4DfCsy6qaO9jstrJGMVQlZxxbDzgvsDazMmyh9lTwtup+5TGmxk+I
e7HziEFBun8sf1BhDfwm1CJfAQs28lkuD4KctV3DuKyXYqDBftEr0fguxCtqNCtJ
0dTcSkPFzKU=
=jim1
-END PGP SIGNATURE-

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



RE: mysqldump syntax - dumping only specific tables starting with a certain character. (e.g. z*)

2009-04-19 Thread ChoiSaehoon

Thanks Uwe, 

 

I used ` now. It says 

ls: z*: no such file or directory exists 

 

then, when I enter the password it dumps all the tables. (instead of tables 
starting with 'z') 

 

Yes, I'm a newbie. (I didn't know to use ` instead of '...)

 

But please help me. Plz tell me what I've done wrongly this time. :)

 


 
 Date: Sun, 19 Apr 2009 16:29:48 +0200
 From: m...@kiewel-online.ch
 To: saeho...@hotmail.com
 CC: mysql@lists.mysql.com
 Subject: Re: mysqldump syntax - dumping only specific tables starting with a 
 certain character. (e.g. z*)
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 ChoiSaehoon schrieb:
  I tried it, then it gives the following error message
  
  mysqldump: Can't get CREATE TABLE for table 'ls z*' (Table '(db-name).ls 
  z*' doesn't exist)
  
  What does 'ls' mean? (as in linux command 'ls'?)
 
 you have to use the ` sign, not the '
 
 Uwe
 
 
 
  
  :)
  
  
  Date: Sun, 19 Apr 2009 08:53:36 -0500
  Subject: Re: mysqldump syntax - dumping only specific tables starting with 
  a certain character. (e.g. z*)
  From: jlyons4...@gmail.com
  To: saeho...@hotmail.com
  CC: mysql@lists.mysql.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
  
  _
  강력해진 보안성, 아웃룩을 닮아 편리해진 기능들로 무장한 Windows Live Hotmail! 지금 로그인해 보세요!
  http://www.hotmail.com
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iQIVAwUBSes1W0JXG7BUuynnAQJWExAAuzKonpnWPeynnFyvodfGYSP1p9A5ybC6
 Azi0j4iGk237HlJ8I8OKh+aBsQGnykzGEQ5eE4xAAaL7bocFlYjHkvaIAhqxzg7c
 /ZaS9j8k+sGrteAsiA1y8fTj4L3uzLJP+0+crm1yKGKO8Jl9BKxqWl+x3Di6XMYF
 1R8OdgBDY1mClUZEqbbBtm0pOs6N/SGcLGyiZNH5xEyRrnXbrh24WY0OQov5pDPj
 T2G0vC2GpZOZEN1qQeJp5G2ZZ+8gPvZhW+cMElvLNVF3aWkWyd/hEFIxG0cBZ/cR
 afcreK3AcnAP80ng8150cFN+y5nMR5GExqPDx1j91s9zdW7poMjZiRZKjAOMSqJv
 Aj+m/MitxGECTOIrCiYo9kP5CyzT6LIng9jyqiNCNR3L2T4sx/LgpLvap+ynwsmz
 kbqBaLcuPwzCW2f5eIYsfrh5lJMoF86GjTshbFnXXk/EN4etcjTTuFJMiNqPjqvy
 jonw0b1S17qHRJJPSfLvgk0NEWOB6tYQQuVcWyZyEb0TamfHP04Vdbe9NIKexU04
 gafSM5pOBed4DfCsy6qaO9jstrJGMVQlZxxbDzgvsDazMmyh9lTwtup+5TGmxk+I
 e7HziEFBun8sf1BhDfwm1CJfAQs28lkuD4KctV3DuKyXYqDBftEr0fguxCtqNCtJ
 0dTcSkPFzKU=
 =jim1
 -END PGP SIGNATURE-
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe: http://lists.mysql.com/mysql?unsub=saeho...@hotmail.com
 

_
MSN 메신저의 차세대 버전, Windows Live Messenger!
http://windowslive.msn.co.kr/wlm/messenger/

Re: mysqldump syntax - dumping only specific tables starting with a certain character. (e.g. z*)

2009-04-19 Thread Uwe Kiewel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

ChoiSaehoon schrieb:
 Thanks Uwe,
  
 I used ` now. It says
 ls: z*: no such file or directory exists

You need to use the path full qualified, e.g. ls /var/lib/mysql/db/z*,
or wherever your mysql installation live.


  
 then, when I enter the password it dumps all the tables. (instead of
 tables starting with 'z')
  
 Yes, I'm a newbie. (I didn't know to use ` instead of '...)
  
 But please help me. Plz tell me what I've done wrongly this time. :)
  
 
  
 Date: Sun, 19 Apr 2009 16:29:48 +0200
 From: m...@kiewel-online.ch
 To: saeho...@hotmail.com
 CC: mysql@lists.mysql.com
 Subject: Re: mysqldump syntax - dumping only specific tables starting
 with a certain character. (e.g. z*)

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 ChoiSaehoon schrieb:
  I tried it, then it gives the following error message
 
  mysqldump: Can't get CREATE TABLE for table 'ls z*' (Table
 '(db-name).ls z*' doesn't exist)
 
  What does 'ls' mean? (as in linux command 'ls'?)

 you have to use the ` sign, not the '

 Uwe



 
  :)
 
 
  Date: Sun, 19 Apr 2009 08:53:36 -0500
  Subject: Re: mysqldump syntax - dumping only specific tables
 starting with a certain character. (e.g. z*)
  From: jlyons4...@gmail.com
  To: saeho...@hotmail.com
  CC: mysql@lists.mysql.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
 
  _
  강력해진 보안성, 아웃룩을 닮아 편리해진 기능들로 무장한 Windows Live
 Hotmail! 지금 로그인해 보세요!
  http://www.hotmail.com

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iQIVAwUBSes1W0JXG7BUuynnAQJWExAAuzKonpnWPeynnFyvodfGYSP1p9A5ybC6
 Azi0j4iGk237HlJ8I8OKh+aBsQGnykzGEQ5eE4xAAaL7bocFlYjHkvaIAhqxzg7c
 /ZaS9j8k+sGrteAsiA1y8fTj4L3uzLJP+0+crm1yKGKO8Jl9BKxqWl+x3Di6XMYF
 1R8OdgBDY1mClUZEqbbBtm0pOs6N/SGcLGyiZNH5xEyRrnXbrh24WY0OQov5pDPj
 T2G0vC2GpZOZEN1qQeJp5G2ZZ+8gPvZhW+cMElvLNVF3aWkWyd/hEFIxG0cBZ/cR
 afcreK3AcnAP80ng8150cFN+y5nMR5GExqPDx1j91s9zdW7poMjZiRZKjAOMSqJv
 Aj+m/MitxGECTOIrCiYo9kP5CyzT6LIng9jyqiNCNR3L2T4sx/LgpLvap+ynwsmz
 kbqBaLcuPwzCW2f5eIYsfrh5lJMoF86GjTshbFnXXk/EN4etcjTTuFJMiNqPjqvy
 jonw0b1S17qHRJJPSfLvgk0NEWOB6tYQQuVcWyZyEb0TamfHP04Vdbe9NIKexU04
 gafSM5pOBed4DfCsy6qaO9jstrJGMVQlZxxbDzgvsDazMmyh9lTwtup+5TGmxk+I
 e7HziEFBun8sf1BhDfwm1CJfAQs28lkuD4KctV3DuKyXYqDBftEr0fguxCtqNCtJ
 0dTcSkPFzKU=
 =jim1
 -END PGP SIGNATURE-

 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe: http://lists.mysql.com/mysql?unsub=saeho...@hotmail.com

 
 
 강력한 폴더 공유 기능과 무료 문자 메시지, 오프라인 쪽지 보내기 기능까지!
 MSN 메신저의 차세대 버전, Windows Live Messenger!
 http://windowslive.msn.co.kr/wlm/messenger/

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIVAwUBSetE9UJXG7BUuynnAQLWXQ/6AhduBZHFSrfsyhmaK0yRjjy6H6+fWZ0s
cUfCANJlGbkP1RW6VpMVeF6U2o8xDBcs7m4OLOfLckT5/Lf+RX7AFj9T9T++3oPd
DMGZzHEAStApcD0yvYqDPi5Mc88aPUdBaJyNbhc1Ufs+8M42T5sGkqfPWjB5r4Co
REdKFt+6JC7VlIBGNn0EdVYA554IQ+93WJus5p9IGk+k5YS5NNBzDiF38SNRszco
2qH9b7I3FP8nxYnlWbpbNdVb0WC5RRk8HojpOE1X+jSJKcWqiebjC+ayVkAytgKL
zZUxcmBmQjf2lRpbMatpR2YV1TZKLkWu6nMCfdYFtK/ggxrA23riIbvehjibXRIJ
JdLSUp49EWUSx9Fk3DrsuDHiXyZy0mhcEanmBNU5jQSspq6pseYWXDoQUBW1TXY1
i9fs0nItaI+dXZcyvcMbYDRXsttuPUrfzB9lEQORPK2d7htxnsCRZtL0vcMmV8b7
yGVkirLyL4+6RlSnEfGk0lxb+Hi6MgVvOJ2V1J46A0pF6Pab+Mwi0+RoQ3YcLdPI
OaWsVGelx+gKsY1szB7kYq2mfHcN+L0Hcdh+6U06+Y2SvJgavVn57sBTislBPfds
fl3DfDdHayBFDI2IyrpLPuvq7Zug1Raj4pc8SyMswVeN0MWI4akxl77+hVTeKfrS
UYxuDNNhrSc=
=OFKv
-END PGP SIGNATURE-

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: mysqldump syntax - dumping only specific tables starting with a certain character. (e.g. z*)

2009-04-19 Thread Jim Lyons
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 -eshow 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