Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8536913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:46:33+00:00 2026-06-11T10:46:33+00:00

I have a query . I have two tables on two different servers .Both

  • 0

I have a query . I have two tables on two different servers .Both the tables have the same structure . The master table on one server gets updated on a daily basis , so i want a cron job or a php script cron to update the second slave table on a different server .
I have seen a lot of scripts but none resolved my requirements .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:46:35+00:00Added an answer on June 11, 2026 at 10:46 am

    I can’t believe you didn’t find a suitable script to do this. Depending on server-to-server bandwidth and connectivity, and table data size, you can:

    • directly transfer the whole table:

      mysqldump [options] sourcedatabase tablename \
        | mysql [options] --host remoteserver --user username ...
      
    • transfer the table with MySQL compression

      # same as above, mysql has the "-C" flag
      
    • transfer using SSH encryption and compression; mysql is executed remotely

      mysqldump [options] sourcedatabase tablename \
        | ssh -C user@remoteserver 'mysql [options]'
      
    • transfer using intermediate SQL file and rsync to transfer only modifications

      mysqldump [options] sourcedb tbl > dump.sql
      rsync [-z] dump.sql user@remoteserver:/path/to/remote/dump.sql
      ssh user@remoteserver "mysql [options] < /path/to/remote/dump.sql"
      

    The above are all simple table overwrites, remote data is LOST and replaced by the master copy. The mysqldump-plus-rsync-plus-ssh runs in a time roughly proportional to modifications, which means that if you have a 10-GB SQL dump and add a dozen INSERTS, the transfer stage will need at most a couple seconds to synchronize the two SQL files.

    To optimize the insert stage too, either you go for full MySQL replication, or you will need a way to identify operations on the table in order to replicate them manually at sync time. This may require alterations to the table structure, e.g. adding “last-synced-on” and “needs-deleting” columns, or even introduction of ancillary tables.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using SQL Server 2008 (R2). I have two tables in different databases (with same
I have two different tables, lead and click. I would like to query MySQL
I have two tables on different servers, and I'd like some help finding an
RDBMS SQL Server, T-SQL Consider a table that links information from two different tables:
I have the query to select some columns from two tables, which must contain
I have a relatively simple query joining two tables. The Where criteria can be
Given a database with two tables X and Y , I have a query
I have two tables in my database table1, table2. I have a join query
I have the following query where I combine two fields from two tables: <cfquery
I have an INSERT query that is pulling data from two tables and inserting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.