SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Copy a database

  1. #1
    SitePoint Addict
    Join Date
    Mar 2002
    Location
    Miami, Florida - Caracas, Venezuela
    Posts
    379
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Copy a database

    I've found various ways to copy a database from one server to another usinf mysqldump but I'd like to simply copy an entire database into the same server but with a different name.

    ie.: I now have a "development" database and want to copy as "production" database.

    Thank you,
    Luis

  2. #2
    SitePoint Enthusiast
    Join Date
    Jun 2004
    Location
    Dallas
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can copy the MySQL datafiles themselves over to another host. Normally located under /var/db/mysql/ or similar, depends on distro.

    When you say different name, do you mean to actually rename the database itself?

    Also, what operating system are you running this one?
    http://www.neo.net - Dedicated Servers
    sales@neo.net
    1.800.508.5075

  3. #3
    SitePoint Addict
    Join Date
    Mar 2002
    Location
    Miami, Florida - Caracas, Venezuela
    Posts
    379
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want to duplicate a database in the same server but with a different name.

    Basically a copy for me to test stuff on and leave the original untouched.

    Linux-Apache-MySQL 4.1-PHP

    Tnx
    Luis

  4. #4
    SitePoint Wizard Lats's Avatar
    Join Date
    Jun 2003
    Location
    Melbourne, AU
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I believe the best way is to do a mysqldump, create a new database, then import your sql file into it.
    Lats...


Bookmarks

Posting Permissions

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