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 Active Member

    Messages:
    56
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    70
    #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. BuySiteAds.com

    BuySiteAds.com Well-Known Member

    Messages:
    945
    Likes Received:
    34
    Best Answers:
    1
    Trophy Points:
    125
    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
    BuySiteAds.com, Nov 1, 2013 IP
  4. ZyreX

    ZyreX Active Member

    Messages:
    56
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    70
    #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. BuySiteAds.com

    BuySiteAds.com Well-Known Member

    Messages:
    945
    Likes Received:
    34
    Best Answers:
    1
    Trophy Points:
    125
    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 :)
    BuySiteAds.com, 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:
    35
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    38
    #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:
    253
    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 Well-Known Member

    Messages:
    1,226
    Likes Received:
    110
    Best Answers:
    51
    Trophy Points:
    160
    #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 Active Member

    Messages:
    287
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    88
    #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:
    8
    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 Member

    Messages:
    231
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    43
    #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:
    32
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    58
    #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:
    3,923
    Likes Received:
    279
    Best Answers:
    16
    Trophy Points:
    245
    #15

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

    NetStar Well-Known Member

    Messages:
    1,140
    Likes Received:
    109
    Best Answers:
    19
    Trophy Points:
    115
    #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