SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    HI silver trophy Silverado4x4's Avatar
    Join Date
    Jan 2001
    Location
    USA
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Transferring A MySQL Database

    What would be the best way to transfer a database from one server to another?

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Step 1:

    using mysqldump dump the contents of the database into a text file.
    from the command prompt:
    mysqldump -u username -p dbname > dbname.sql
    //dbname should be the actual name of the database


    Step 2:

    Create the new database on the new server.

    Step 3:

    Put that text file dbname.sql on your new server through ftp.

    Step 4:

    ssh into your new server and and cd into the dir holding the dbname.sql


    Step 5:

    import the data

    mysql -u username -p newdbname < dbname.sql



    Thats it in a nutshell, post if you have any questions.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    HI silver trophy Silverado4x4's Avatar
    Join Date
    Jan 2001
    Location
    USA
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On Step One, how do I know where it will save on my hard drive?

    Forgive me if I misunderstood the step...

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well if run the command while in the C:\ folder it will be in the C:\ folder if you ran it in c:\mysite it would end up in c:\mysite
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    HI silver trophy Silverado4x4's Avatar
    Join Date
    Jan 2001
    Location
    USA
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What do you mean if I were in the folder C:\? I'm using tera-byte web hosting, and I don't see how I could be in that folder if I were telneting...


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
  •