Results 1 to 13 of 13
  1. #1

    How to transfer an MySQL Database

    hi,

    i have transfer a domain from a server into another server with Cpanel Feature.
    Problem is that the 2 databases on that domain has not ben transfered wih this move.

    Please can anyone tell me how exactly to move the databases
    from one server to another manually?

    Thanks

  2. #2
    Good question.

    I would also like to know the answer.

    I hardly ever work with MySQL, but this week I am working on a PHP/MySQL project.

    Any MySQL gurus out there who can answer this?

    It would be greatly appriciated.

  3. #3
    Join Date
    Jan 2002
    Location
    Melbourne, AU
    Posts
    740
    It depends on the size of the db. About less than 2 meg, you can do it via phpmyadmin, otherwise you'll need shell access.

    Do a search here for backup and/or restore for some tips.


    Lats...
    Lats...

  4. #4
    Join Date
    Oct 2001
    Location
    Ohio
    Posts
    8,299
    If you have shell access login and all.
    Then do mysqldump --opt -u dbusername -p dbname > /your-path-to-root-directory/dump.sql
    It'll ask you for the mySQL Database password then. Just put that in, and it'll show up in your root

  5. #5
    Join Date
    Feb 2002
    Posts
    1,926
    What I always use:

    On the original server/account:

    mysqldump -uMYsqlusername -pMYsqlpassword databasename > /directory/somewhere/whateveryouwanttocallit.sql

    Download that file.

    On the new server/account:

    Upload the file.

    mysql -uMYsqlusername -pMYsqlpassword databasename < /directory/somewhere/yourbackup.sql

    Regards.

  6. #6
    Join Date
    Aug 2002
    Location
    England
    Posts
    145
    If you've got shell access on both servers you could do the dump as described above. Move the dump to a public html directory, login to the other server and use wget to retrieve the dump. That way you don't have to download it to your pc.
    Josh Powell.
    ServerSpotCheck - Is your website down?
    Skimpylink - Not as tiny as some but much cuter!

  7. #7
    Join Date
    Apr 2001
    Location
    Depok, Indonesia
    Posts
    988
    Originally posted by joshp
    If you've got shell access on both servers you could do the dump as described above. Move the dump to a public html directory, login to the other server and use wget to retrieve the dump. That way you don't have to download it to your pc.
    To do it more directly if you have shell access on both servers:

    (from source server)
    mysqldump -uuser -ppass mysqldb | gzip | ssh [email protected] "gunzip | mysql -uuser -ppass mysqldb"

  8. #8
    hi,
    seem it does not work as Tazzman said.

    I doing this:

    going to the old server as root and then:

    cd /var/lib/mysql

    then:
    mysqldump

    thats all......

    dont know what do to now.

    if i do:
    uMYsqlusername give an error


    Please can anyone give me some step by step istructions?


    Lot of thanks to all!!

  9. #9
    Join Date
    Aug 2002
    Location
    England
    Posts
    145
    What tazzman gave you was step by step instructions

    mysqldump -u MYsqlusername -p MYsqlpassword databasename > /directory/somewhere/whateveryouwanttocallit.sql

    That line entered at the command prompt, replacing MYsqlusername with your actual "MySQL username" and MYsqlpassword with your actual "MySQL password" and obviously the location of where you want the dump to go and name will do what you want.
    Josh Powell.
    ServerSpotCheck - Is your website down?
    Skimpylink - Not as tiny as some but much cuter!

  10. #10
    Join Date
    Sep 2002
    Location
    CA , US.
    Posts
    364
    You know how i transfer my mysql databases ?

    Through the software (not available anymore) MySqlFront. It downloads from one host and then uploads it to another host. very simple and easy.

    Some hosts let you do it some dont. You gotta talk to them if you dont own the server yourself.
    { if Need Graphic Design? then Ask Graphics }
    @ http://www.askgraphics.com

  11. #11
    Join Date
    Aug 2002
    Location
    Toronto, Canada
    Posts
    286
    If your database is less then 2 megs, use phpMyAdmin

    If not.... you can still use phpMyAdmin to make a backup. Then, if possible, cut it into several pieces, (using notepad), lol, and use phpMyAdmin to restore it piece by piece.

    BACKUP :
    in phpmyadmin there is an option to export structure, data, or both... select the option to save it to a file

    RESTORE
    go to the main page of the db you want to restore to, and tell it to run a query, but tell it you want to use a file and click the browse button, locate the file and click go....

    let me know if you get it working....
    www.prolinker.com - free automatic linking to your website

  12. #12
    Join Date
    Oct 2002
    Location
    Canada, QC, Montreal
    Posts
    302
    USe these tools if you don't have shell access and a big db

    http://membres.lycos.fr/webforumgp/xtdump
    http://membres.lycos.fr/webforumgp/uqiqi


  13. #13
    Join Date
    Aug 2002
    Posts
    636
    also remember, as Ive seen many hosts miss this, that if you are using CPanel on that dump of SQL that when you UPLOAD everything to the new server that you do NOT forget the username prefixes.

    For example, if the username for the account is ghost and the DB user is forum, then the DBUSER would be ghost_forum

    Follow? Small things like that you need not forget.
    Geek 3 Computer Repair

Posting Permissions

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