Results 1 to 2 of 2
  1. #1
    Join Date
    May 2007
    Posts
    80

    Unanswered: how to copy from a remote database to a local database with SQL ?

    Got a database on a webserver and a local copy. I want to copy from the remote database into the local database. Actually there can be many local copies.

    ( disregarding the subject of replication for a moment )

    Can this be done inside SQL ?
    I know you can copy between databases like this:

    SELECT * FROM database1.tableX
    INTO database2.tableX;

    but this is when the databases are located on the same MySQL server.
    Is there an equivalent syntax with a remote database ?

    SELECT * FROM serverA.database1.tableX
    INTO serverB.database2.tableX;


    Is there an alternative method to achieve the same thing but staying inside the world of MySQL, inside SQL, procedures, scripts, etc... ? I know i can write an application to do it ( read from one DB and insert into the other) and i know about replication but they add another layer to the overall system both in terms of development and maintenance that i'd like to avoid.

  2. #2
    Join Date
    May 2007
    Posts
    80
    Could someone who actually knows for sure confirm that this:

    SELECT * FROM serverA.database1.tableX
    INTO serverB.database2.tableX;

    cannot be done, in whatever form, inside MySQL.
    ( or if it can be done then HOW ??? )

    You can only do that through an application or MySQL replication.

    Please.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •