1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to upload a huge database?

Discussion in 'Databases' started by Halil D., Nov 1, 2013.

  1. #1
    Hi,
    Can i anyone help me How to upload a huge database?
    an easy method?or script?

    thanks all
     
    Halil D., Nov 1, 2013 IP
  2. ZyreX

    ZyreX Well-Known Member

    Messages:
    104
    Likes Received:
    13
    Best Answers:
    1
    Trophy Points:
    115
    #2
    Upload or Import?

    To upload , there is no other way then just normal upload using a FTP client.

    To import, I always use Big Dump: http://www.ozerov.de/bigdump/

    Basically, what you need to do is:
    1. Upload the database on the server using a FTP client .
    2. Upload bigdump.php in the same folder with the database.
    3. Edit Big dump config files and provide the local path to the database that you want to import and then the config details of your new database ( where you want to import)
    4. Let Big Dump to do the Job. Just run bigdump.php
     
    Last edited: Nov 1, 2013
    ZyreX, Nov 1, 2013 IP
    Nigel Lew likes this.
  3. Zoti Media Group

    Zoti Media Group Notable Member

    Messages:
    1,598
    Likes Received:
    113
    Best Answers:
    2
    Trophy Points:
    265
    Digital Goods:
    2
    #3
    Please ask your hosting provider to extand the mysql import in php.ini. Should look it for : upload_max_filesize, post_max_size
     
    Zoti Media Group, Nov 1, 2013 IP
  4. ZyreX

    ZyreX Well-Known Member

    Messages:
    104
    Likes Received:
    13
    Best Answers:
    1
    Trophy Points:
    115
    #4
    From Security and performance point of view they wont do that :) But that's another subject

    plus , bigdump it's pretty easy and you dont have to wait for a response from your webhost.
     
    ZyreX, Nov 1, 2013 IP
  5. Zoti Media Group

    Zoti Media Group Notable Member

    Messages:
    1,598
    Likes Received:
    113
    Best Answers:
    2
    Trophy Points:
    265
    Digital Goods:
    2
    #5
    upload the database at other server and start to export only 50-100 tables. Create a database at your restricted host and start to import the tables.
    But if they wont allow you to upload more then 50m or similiar and you upload 1 gb your account may be suspended. So take care :)
     
    Zoti Media Group, Nov 1, 2013 IP
  6. lenawilliam07

    lenawilliam07 Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #6
    down load it as usual using FTP client
     
    lenawilliam07, Nov 6, 2013 IP
  7. Halil D.

    Halil D. Member

    Messages:
    34
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    48
    #7
    This was very helpful.thank you very much
     
    Halil D., Nov 6, 2013 IP
  8. Dot_Net

    Dot_Net Greenhorn

    Messages:
    30
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    23
    #8
    Make sure you change both *"post_max_size"* and *"upload_max_filesize"* in your "php.ini" (which is located where your "php.exe" is).

    The following example allows you to upload and import 128MB sql files:

    post_max_size=128M
    upload_max_filesize=128M
    Restart Apache and you're all set.

    An alternative way to work around the problem is to use the command line. But it's a workaround, and as ugly as workarounds get:

    C:\xampp\mysql\mysql.exe -u root -p db_name < C:\some_path\your_sql_file.sql


    As you're not using the server but the command line, upload and POST sizes don't matter. That's why I call this a "workaround", since it doesn't actually solve your problem.
     
    Dot_Net, Nov 13, 2013 IP
    seotraining likes this.
  9. whosedomain

    whosedomain Active Member

    Messages:
    257
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #9
    if your new hosting is using the same version of mysql, you can copy your old database and upload it to your new hosting directly.
     
    whosedomain, Nov 17, 2013 IP
  10. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #10
    It's sort of funny to look at people saying that php.ini is in the same folder as php.exe, and listing a Windows-commandline syntax for doing it via command line. Frankly, I don't think many database servers run Windows... at least not when he asks how to upload it - not many hosts running on Windows.
     
    PoPSiCLe, Nov 18, 2013 IP
  11. pmf123

    pmf123 Notable Member

    Messages:
    1,447
    Likes Received:
    75
    Best Answers:
    0
    Trophy Points:
    215
    #11
    place the source file in the folder that contains the mysql database

    login to mysql as admin
    GRANT FILE PRIVILEGES ON database.* TO 'mysqluser'@'%' IDENTIFIED BY 'mysqlpassword'

    login to mysql as mysqluser
    LOAD DATA INFILE 'source.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n'

    doing this from memory so there may be a typo in there somewhere.

    this eliminated the php upload file size limits
     
    pmf123, Nov 19, 2013 IP
  12. tetcuo

    tetcuo Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #12
    download FILEZILLA and Google it how to use it , and your done.
     
    tetcuo, Dec 25, 2013 IP
  13. superprg

    superprg Well-Known Member

    Messages:
    292
    Likes Received:
    49
    Best Answers:
    0
    Trophy Points:
    120
    #13
    You haven't specified how big the size is, but you can always use phpmyadmin for import
    Default size is 2 MB and you can change it in php.ini by changing post_max_size and upload_max_filesize
     
    superprg, Dec 30, 2013 IP
  14. micoe

    micoe Active Member

    Messages:
    40
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    83
    #14
    I am also looking the good method to upload big mysql, I will try bigdump
     
    micoe, Jan 5, 2014 IP
  15. Nigel Lew

    Nigel Lew Notable Member

    Messages:
    4,642
    Likes Received:
    405
    Best Answers:
    21
    Trophy Points:
    295
    #15

    This is the only useful response here.
    Nigel
     
    Nigel Lew, Jan 5, 2014 IP
  16. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #16
    Here is something I wrote about moving a large database from one server to another



    Log in to your server via SSH

    mysqldump -u YOUR_DB_USER -p YOUR_DB_NAME > YOUR_SQL_TO_BE_MADE_X-XX-2009.sql

    It'll prompt you for your password. Type it in. It'll generate an SQL file of your complete database.

    THEN...

    tar -cvf YOUR_SQL_FILE_GENERATED_X-XX-2009.sql
    gzip YOUR_SQL_FILE_GENERATED_X-XX-2009.tar

    Now you have a compressed file named YOUR_SQL_FILE_GENERATED_X-XX-2009.tar.gz

    Now log into your new (or other) server via SSH. And...

    ftp ftp.YOUR_OLD_SERVER_ADDRESS
    dir DIRECTORY_NAME
    get YOUR_SQL_FILE_GENERATED_X-XX-2009.tar.gz
    quit

    That'll transfer the backup file no matter how large it is... Then from the new servers terminal:

    tar -xzvf YOUR_SQL_FILE_GENERATED_X-XX-2009.tar.gz

    It'll decompress and extract YOUR_SQL_FILE_GENERATED_X-XX-2009.sql

    Then you type (assuming you created the mysql database and a user):

    mysql -u YOUR_DB_USER -p YOUR_DB_NAME < YOUR_SQL_FILE_GENERATED_X-XX-2009.sql

    And your server will automatically import the backup.
     
    NetStar, Jan 6, 2014 IP