mysql diff and add diff records into new database












0















I have two database on two different hosts:



host A has database A and table A
and
host B has database B and table B


and now



"host A/database A/table A" 
table A contains records with primary key 1 to 10


and



"host B/database B/table B" 
table B contains records with primary key 1 to 5


now i have to take DIFF between this two separate host/databases/table
i.e.,



"host A/database A/table A" contains 1-10 
"host B/database B/table B" contains 1-5


so records 6-10 is missing in host B/database B/table B
now add this DIFF records into "host B/database B/table B" from "host A/database A/table A"



In short update development database with new production data since last update



what i have tried untill now



mysqldump --replace --complete-insert --skip-disable-keys --no-create-info -h A --port=3306 -u A --password=A database_A table_A | mysql -h B -u B --password=B database_B










share|improve this question
















bumped to the homepage by Community 27 secs ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    0















    I have two database on two different hosts:



    host A has database A and table A
    and
    host B has database B and table B


    and now



    "host A/database A/table A" 
    table A contains records with primary key 1 to 10


    and



    "host B/database B/table B" 
    table B contains records with primary key 1 to 5


    now i have to take DIFF between this two separate host/databases/table
    i.e.,



    "host A/database A/table A" contains 1-10 
    "host B/database B/table B" contains 1-5


    so records 6-10 is missing in host B/database B/table B
    now add this DIFF records into "host B/database B/table B" from "host A/database A/table A"



    In short update development database with new production data since last update



    what i have tried untill now



    mysqldump --replace --complete-insert --skip-disable-keys --no-create-info -h A --port=3306 -u A --password=A database_A table_A | mysql -h B -u B --password=B database_B










    share|improve this question
















    bumped to the homepage by Community 27 secs ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0








      I have two database on two different hosts:



      host A has database A and table A
      and
      host B has database B and table B


      and now



      "host A/database A/table A" 
      table A contains records with primary key 1 to 10


      and



      "host B/database B/table B" 
      table B contains records with primary key 1 to 5


      now i have to take DIFF between this two separate host/databases/table
      i.e.,



      "host A/database A/table A" contains 1-10 
      "host B/database B/table B" contains 1-5


      so records 6-10 is missing in host B/database B/table B
      now add this DIFF records into "host B/database B/table B" from "host A/database A/table A"



      In short update development database with new production data since last update



      what i have tried untill now



      mysqldump --replace --complete-insert --skip-disable-keys --no-create-info -h A --port=3306 -u A --password=A database_A table_A | mysql -h B -u B --password=B database_B










      share|improve this question
















      I have two database on two different hosts:



      host A has database A and table A
      and
      host B has database B and table B


      and now



      "host A/database A/table A" 
      table A contains records with primary key 1 to 10


      and



      "host B/database B/table B" 
      table B contains records with primary key 1 to 5


      now i have to take DIFF between this two separate host/databases/table
      i.e.,



      "host A/database A/table A" contains 1-10 
      "host B/database B/table B" contains 1-5


      so records 6-10 is missing in host B/database B/table B
      now add this DIFF records into "host B/database B/table B" from "host A/database A/table A"



      In short update development database with new production data since last update



      what i have tried untill now



      mysqldump --replace --complete-insert --skip-disable-keys --no-create-info -h A --port=3306 -u A --password=A database_A table_A | mysql -h B -u B --password=B database_B







      mysql mysqldump ddl






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 19 '16 at 6:14







      mOsEs

















      asked Feb 18 '16 at 12:39









      mOsEsmOsEs

      12




      12





      bumped to the homepage by Community 27 secs ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 27 secs ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          mysqldump --insert-ignore --extended-insert=FALSE --complete-insert --skip-disable-keys --no-create-info -h A --port=3306 -u A --password=A database_A table_A | mysql -h B -u B --password=B database_B



          --insert-ignore eventually worked as diff and made the rows unique while dumping data across database






          share|improve this answer





















          • 2





            If you would add a little more detail to your answer, future readers will also be able to use and understand it.

            – Daniel Hutmacher
            Feb 19 '16 at 9:45











          • @DanielHutmacher thanks for pointing it out

            – mOsEs
            Mar 29 '16 at 11:30











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "182"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f129674%2fmysql-diff-and-add-diff-records-into-new-database%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          mysqldump --insert-ignore --extended-insert=FALSE --complete-insert --skip-disable-keys --no-create-info -h A --port=3306 -u A --password=A database_A table_A | mysql -h B -u B --password=B database_B



          --insert-ignore eventually worked as diff and made the rows unique while dumping data across database






          share|improve this answer





















          • 2





            If you would add a little more detail to your answer, future readers will also be able to use and understand it.

            – Daniel Hutmacher
            Feb 19 '16 at 9:45











          • @DanielHutmacher thanks for pointing it out

            – mOsEs
            Mar 29 '16 at 11:30
















          0














          mysqldump --insert-ignore --extended-insert=FALSE --complete-insert --skip-disable-keys --no-create-info -h A --port=3306 -u A --password=A database_A table_A | mysql -h B -u B --password=B database_B



          --insert-ignore eventually worked as diff and made the rows unique while dumping data across database






          share|improve this answer





















          • 2





            If you would add a little more detail to your answer, future readers will also be able to use and understand it.

            – Daniel Hutmacher
            Feb 19 '16 at 9:45











          • @DanielHutmacher thanks for pointing it out

            – mOsEs
            Mar 29 '16 at 11:30














          0












          0








          0







          mysqldump --insert-ignore --extended-insert=FALSE --complete-insert --skip-disable-keys --no-create-info -h A --port=3306 -u A --password=A database_A table_A | mysql -h B -u B --password=B database_B



          --insert-ignore eventually worked as diff and made the rows unique while dumping data across database






          share|improve this answer















          mysqldump --insert-ignore --extended-insert=FALSE --complete-insert --skip-disable-keys --no-create-info -h A --port=3306 -u A --password=A database_A table_A | mysql -h B -u B --password=B database_B



          --insert-ignore eventually worked as diff and made the rows unique while dumping data across database







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 29 '16 at 11:29

























          answered Feb 19 '16 at 8:17









          mOsEsmOsEs

          12




          12








          • 2





            If you would add a little more detail to your answer, future readers will also be able to use and understand it.

            – Daniel Hutmacher
            Feb 19 '16 at 9:45











          • @DanielHutmacher thanks for pointing it out

            – mOsEs
            Mar 29 '16 at 11:30














          • 2





            If you would add a little more detail to your answer, future readers will also be able to use and understand it.

            – Daniel Hutmacher
            Feb 19 '16 at 9:45











          • @DanielHutmacher thanks for pointing it out

            – mOsEs
            Mar 29 '16 at 11:30








          2




          2





          If you would add a little more detail to your answer, future readers will also be able to use and understand it.

          – Daniel Hutmacher
          Feb 19 '16 at 9:45





          If you would add a little more detail to your answer, future readers will also be able to use and understand it.

          – Daniel Hutmacher
          Feb 19 '16 at 9:45













          @DanielHutmacher thanks for pointing it out

          – mOsEs
          Mar 29 '16 at 11:30





          @DanielHutmacher thanks for pointing it out

          – mOsEs
          Mar 29 '16 at 11:30


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Database Administrators Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f129674%2fmysql-diff-and-add-diff-records-into-new-database%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          SQL Server 17 - Attemping to backup to remote NAS but Access is denied

          Always On Availability groups resolving state after failover - Remote harden of transaction...

          Restoring from pg_dump with foreign key constraints