sinc two mysql database

Discussion in 'PHP' started by srdva59, Jul 25, 2009.

  1. #1
    hi,
    i have my server on real world and my a bd on my pc of work
    and i need something to sinc the two bd.
    there is some internal function that to that or a script?
    i don´t have time to build a script for this
    the objetive is to have the to bd equal in new records and edit and deleted
    any values.
    thanks for your help
    :)
     
    srdva59, Jul 25, 2009 IP
  2. kblessinggr

    kblessinggr Peon

    Messages:
    539
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I'm assuming English is a second language to you.

    I'm assuming by 'bd' you actually mean 'db' (database)

    If both machines run off cpanel, you should be able to open up phpMyAdmin and simply export the SQL file from one, then import the same file into the other.

    Otherwise use mysqldump in the console.

    
    mysqldump –-user username –-password=yourpassword yourdatabasename > export.sql
    
    Code (markup):
    Then you'd upload the sql file to your new server
    
    mysql -u username -p yourpassword yourdatabasename < export.sql
    
    Code (markup):
    Basically what that'll do is import the file you exported from your other machine, into the specified database. database #1 contains everything #2 needs, you can drop db #2 before importing the backup (since otherwise unless the SQL dump specifies dropage, you may get duplicate content)
     
    Last edited: Jul 25, 2009
    kblessinggr, Jul 25, 2009 IP
  3. HivelocityDD

    HivelocityDD Peon

    Messages:
    179
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I dont know any scripts of that kind. But you can create a script which will take your database dump in local machine and put that code in your live one.
    This can be achieved using a cron job or you can stimulated a script using the query to be processed on the live one.
     
    HivelocityDD, Jul 25, 2009 IP