What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Copying database

Copying database
Author: Message:
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: Copying database
http://dev.mysql.com/doc/refman/5.0/en/insert-select.html

INSERT INTO targetDB.targetTable SELECT * FROM sourceTable

Of course, you will need to create the target table and set up its structure first. I don't know of a way to copy the structure and data with one query. :-/

Edit: For quickly copying the structure, maybe you could use...

CREATE TABLE targetDB.targetTable LIKE sourceTable

http://dev.mysql.com/doc/refman/5.0/en/create-table.html

Edit 2: Upon further reading of the above link, it seems that you can do...

CREATE TABLE targetDB.targetTable SELECT * FROM sourceTable

To copy the structure and data at once. Amazing. :o

This post was edited on 05-02-2006 at 06:20 PM by WDZ.
05-02-2006 06:13 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Copying database - by Weyzza on 05-02-2006 at 05:58 PM
RE: Copying database - by WDZ on 05-02-2006 at 06:13 PM
RE: Copying database - by Weyzza on 05-02-2006 at 06:22 PM
RE: Copying database - by WDZ on 05-02-2006 at 06:32 PM
RE: Copying database - by Adeptus on 05-02-2006 at 06:36 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On