Copy Table From One DB To Another

Copy Table From One DB To Another

am 16.12.2005 04:14:11 von Michael Avila

------=_NextPart_000_0032_01C601C4.E0732C60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

What is the quickest way to copy each record of a table from one DB to
another? I have a production database that I want to put on a website and
(in most cases) I want to copy the whole record from prod to web.

Is the fastest way to save it to a file and then use the utility to load the
table or is there a faster way?

Thanks.

Mike



------=_NextPart_000_0032_01C601C4.E0732C60
Content-Type: text/plain; charset=us-ascii


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org
------=_NextPart_000_0032_01C601C4.E0732C60--

Re: Copy Table From One DB To Another

am 16.12.2005 07:19:07 von SGreen

--=_alternative 00229DA4852570D9_=
Content-Type: text/plain; charset="US-ASCII"

"Michael Avila" wrote on 12/15/2005
10:14:11 PM:

> What is the quickest way to copy each record of a table from one DB to
> another? I have a production database that I want to put on a website
and
> (in most cases) I want to copy the whole record from prod to web.
>
> Is the fastest way to save it to a file and then use the utility to load
the
> table or is there a faster way?
>
> Thanks.
>
> Mike
>

There are several very fast ways of doing it. The easiest is to just do an
INSERT...SELECT... statement. That way you can change the data, if it
needs it, between the two tables. Refer to the table in the "other"
database with its fully qualified name

if you are in database A and you need data from a table in database B you
use a query like:

INSERT localtablename(...destinatino column list...)
SELECT ...source column list...
FROM B.othertablename
....

To reference a table in another database, all you need to do is to put the
name of the database before the name of the table separating the two with
a period. Please, read this for details:

http://dev.mysql.com/doc/refman/4.1/en/identifier-qualifiers .html

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine
--=_alternative 00229DA4852570D9_=--

Re: Copy Table From One DB To Another

am 19.12.2005 16:32:20 von Joelle Tegwen

I am coming up on a similar conundrum except I will need to move data
from our test server to our production server (different machines,
different instances of MySQL, the whole bit) My current plan is to write
a web script that will do all of the changes, but this got me thinking.
Is there a way to do that within MySQL?

Joelle

Michael Avila wrote:

>What is the quickest way to copy each record of a table from one DB to
>another? I have a production database that I want to put on a website and
>(in most cases) I want to copy the whole record from prod to web.
>
>Is the fastest way to save it to a file and then use the utility to load the
>table or is there a faster way?
>
>Thanks.
>
>Mike
>
>
>
>
>----------------------------------------------------------- -------------
>
>
>
>

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

Re: Copy Table From One DB To Another

am 22.12.2005 17:08:44 von Annemarie Mayer

Joelle, check the federated storage engine at
http://dev.mysql.com/doc/refman/5.0/en/federated-storage-eng ine.html

Regards,
Anne


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org