How to replicate a database?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bruce W...1

    #1

    How to replicate a database?

    I made a MySQL database (4.0.15) on my local Windows 2000 machine. I
    want to copy, replicate, or duplicate it to a MySQL databse at a web
    hosting company. How can I do this?

    My search of the documention didn't turn up much on this.

    Thanks for your help.
  • D. Pickering

    #2
    Re: How to replicate a database?

    That's doable depending on what you really want/need.
    To "syncronize " them in the case that both (Win and WebHost) are changing,
    that's tough but doable in some tricky ways.
    However, if it's just "copy" from Win to Web then one way is
    1. on Windows do "mysqldump yourdb > tmpfile"
    2. send the tmpfile to the Host
    3. On host do " mysql yourdb < tmpfile"
    (Once this is done once, you probably have to do "drop table tablename" on
    all your host tables because the
    mysqldump creates sql commands that create AND populate the table.
    Another completely separate alternative is use ODBC (to connect to the Host
    MySQL) from your windows machine and write scripts to update the host tables
    item by item..(now there's a fancy script...sorry) .

    dp

    "Bruce W...1" <bruce@noDirect Email.com> wrote in message
    news:3F7B995B.4 9EBE5F0@noDirec tEmail.com...[color=blue]
    > I made a MySQL database (4.0.15) on my local Windows 2000 machine. I
    > want to copy, replicate, or duplicate it to a MySQL databse at a web
    > hosting company. How can I do this?
    >
    > My search of the documention didn't turn up much on this.
    >
    > Thanks for your help.
    >[/color]


    Comment

    • D. Pickering

      #3
      Re: How to replicate a database?

      That's doable depending on what you really want/need.
      To "syncronize " them in the case that both (Win and WebHost) are changing,
      that's tough but doable in some tricky ways.
      However, if it's just "copy" from Win to Web then one way is
      1. on Windows do "mysqldump yourdb > tmpfile"
      2. send the tmpfile to the Host
      3. On host do " mysql yourdb < tmpfile"
      (Once this is done once, you probably have to do "drop table tablename" on
      all your host tables because the
      mysqldump creates sql commands that create AND populate the table.
      Another completely separate alternative is use ODBC (to connect to the Host
      MySQL) from your windows machine and write scripts to update the host tables
      item by item..(now there's a fancy script...sorry) .

      dp

      "Bruce W...1" <bruce@noDirect Email.com> wrote in message
      news:3F7B995B.4 9EBE5F0@noDirec tEmail.com...[color=blue]
      > I made a MySQL database (4.0.15) on my local Windows 2000 machine. I
      > want to copy, replicate, or duplicate it to a MySQL databse at a web
      > hosting company. How can I do this?
      >
      > My search of the documention didn't turn up much on this.
      >
      > Thanks for your help.
      >[/color]


      Comment

      Working...