How can I import a 250mb database?

Discussion in 'MySQL' started by Mafishioso, Jun 3, 2007.

  1. #1
    I transferred my site to a new hosting (Dreamhost), no database created yet.

    I have backed up my mysql database and stored in my hard drive.

    The size of the database is 250mb. MyPhp cpanel can only import 10,000 kb.


    How can I upload my site's database to my new hosting?

    Do I need a software to upload it? Where can I get a free one?

    Can it be broken into manageable chunks?.. How?...


    Please help.

    Thank you..
     
    Mafishioso, Jun 3, 2007 IP
  2. Vbot

    Vbot Peon

    Messages:
    107
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    google for a php program name bigdump. It will help you import big database that phpmyadmin cannot.
     
    Vbot, Jun 3, 2007 IP
  3. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #3
    You can try doing it by chunks but it will be very time consuming.

    Can you download the file for the database directly, or use SSH to get the file?

    Also, I found this, a guide to a program, BigDump which can be used in your case:
    _http://www.techduke.com/2007/05/19/guide-to-moving-a-large-mysql-database-to-new-server-using-bigdump/
     
    krt, Jun 3, 2007 IP
  4. Freewebspace

    Freewebspace Notable Member

    Messages:
    6,213
    Likes Received:
    370
    Best Answers:
    0
    Trophy Points:
    275
    #4
    I used bigdump once but it is not very useful I think so!
     
    Freewebspace, Jun 4, 2007 IP
  5. Clark Kent

    Clark Kent Guest

    Messages:
    122
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Your lifesaver is mysqldumper.
    http://www.mysqldumper.de/en

    Just try it you will never use another program for backup/restore/query.
    It restores and backups with partial chunks because of that it never timeouts and you can watch the progress.

    Features:

    * Multilingual
    * Backup and restore of MySQL-Databases
    * Automatic sending of backups via Email or FTP
    * Automatic deleting of backups on the server following your own rules
    * Using a Perl script as a Cronjob
    * Administration and manipulation of databases
    * Backup of database-structures (without data)
    * Backup and restore of tables
    * Protecting your backup via ".htaccess file"
    * Reveals PHP , MySQL version and configuration details and more...!
    * Easy installation
    * Easy operating
    * Multipart-Backup for very large databases
    * Multi-database-Backup!
     
    Clark Kent, Jun 4, 2007 IP
  6. mjesales

    mjesales Peon

    Messages:
    326
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #6
    when i've had to do this - i just uploaded the file to the root directory of the hosting account - then i put in a support ticket for the admin of the server to import it. most were happy to do so.
     
    mjesales, Jun 6, 2007 IP
  7. kashif.nazar

    kashif.nazar Peon

    Messages:
    52
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    First just create the database with the script on the new server.
    then restore the database on your local computer.

    Connect to the remote server database from your local computer.
    Now transfer the data from your local database to the database you created on new server.
    I think it should help .
     
    kashif.nazar, Jun 9, 2007 IP
  8. InFloW

    InFloW Peon

    Messages:
    1,488
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    0
    #8
    The easiest way is to use SSH and make use of mysql on the server.

    So upload the file using FTP to your webspace I'll assume it's called backup.sql. Download puty if you do not have it then put your domain or ip as the address. It should prompt you for a username and password so enter your login information. From there you should now be into the account and in the same location as the .sql file. To confirm this use ls in the folder and it should give you a list of files.

    From here it's quite easy

    mysql -u mysqlusername -pmysqlpassword mysqldatabasename < backup.sql


    Replacing mysqlusername, mysqlpassword and mysqldatabasename with your mysql information. The cleanest way to do it although it requires some knowledge of a command line interface.
     
    InFloW, Jun 9, 2007 IP
  9. yedy72

    yedy72 Well-Known Member

    Messages:
    198
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #9
    i also can recommend mysqldumper, very easy to use and good for make a regular backup
     
    yedy72, Jun 9, 2007 IP
  10. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #10
    i wouldn't recommend throwing the password in with the initial command line argument. not very secure as it will show up in the process list and anyone on the server can view this.

    also to input the password directly via the command line you ned to use --password=password syntax. eg: mysql -u username --password=mypassword

    mysql -u username -p will work just fine and then it will prompt you for your password from within mysql itself and you don't have to worry about people seeing your password in plain text. once you have done that all you have to do is

    use database
    \. /path/to/backup.sql

    voila.
     
    ansi, Jun 9, 2007 IP
  11. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #11
    well i guess i was wrong about it being displayed as plain text. but still from a security standpoint it's not a good idea.

    dopehouse:/home/tballard# ps al | grep "sql"
    0 1000 2229 2218 9 0 6608 2440 read_c S+ pts/0 0:00 mysql -u ansi --password=x xxxxxx
    0 0 2272 2270 14 0 1820 564 pipe_w S+ pts/1 0:00 grep sql
    dopehouse:/home/tballard#
     
    ansi, Jun 9, 2007 IP
  12. Mafishioso

    Mafishioso Well-Known Member

    Messages:
    199
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    103
    #12
    I just tried Bigdump.php. It worked!.. My article directory is ok now. :)

    Thanks a lot guys!.. I appreciated all your help.
     
    Mafishioso, Jun 10, 2007 IP