LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-28-2006, 05:57 AM   #1
grob115
Member
 
Registered: Oct 2005
Posts: 526

Rep: Reputation: 32
Copying database


Hello,

What is the proper mySQL command to use for copying tables beginning with a specific prefix from one database to another on the same database server?
 
Old 01-28-2006, 06:35 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
Something like from a bash prompt (untested):
Code:
mysqldump --opt --databases dbname1 --tables $(echo 'show tables' | mysql world | grep 'tbl_prefix.*') | mysql dbname2
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Snort database: Closing connection to database "" Homer Glemkin Linux - Security 2 07-14-2005 06:58 PM
copying old HD to new? greenmeanie Debian 2 05-24-2005 12:44 PM
Mysql - Copying database files. jackster Linux - Software 2 02-03-2005 02:03 AM
copying MySQL database linuxprogrammer Linux - Newbie 1 07-23-2004 09:53 PM
Copying mysql database to another comp parsek Linux - Software 1 11-15-2003 07:34 PM


All times are GMT -5. The time now is 01:48 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration