If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > how to move tables from one database from another database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-08-08, 06:53
cy163 cy163 is offline
Registered User
 
Join Date: Apr 2007
Posts: 127
how to move tables from one database from another database

Hello All,


I want to move some tables from one database to another one. How to do this in MySQL.


Thanks
Reply With Quote
  #2 (permalink)  
Old 12-08-08, 07:19
cy163 cy163 is offline
Registered User
 
Join Date: Apr 2007
Posts: 127
By googling, I found the following solution

Code:
RENAME TABLE current_db.tbl_name TO other_db.tbl_name;
Reply With Quote
  #3 (permalink)  
Old 12-08-08, 12:05
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
what happened when you tested that?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #4 (permalink)  
Old 12-09-08, 07:26
cy163 cy163 is offline
Registered User
 
Join Date: Apr 2007
Posts: 127
it works well.
Reply With Quote
  #5 (permalink)  
Old 12-09-08, 07:55
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
excellent!!

that's yet another feature of mysql i did not know
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On