Gandi Wiki


You are on a question's page

Accessing your database
new

Question "Importing large database", by Wouter v.

I'm trying to import a (fairly) large database. Dump file is 143MB uncompressed. First I uploaded a gzipped version to the /lamp0/tmp directory and import it. That failed with a "Internal server error" on the screen and an "execution timeout" in fpm.log. I tried splitting the dump up in smaller files, with the same result with one of the files.

Then I tried the same files, uncompressed. This failed with an incorrect key error after a very long waiting time. I've retried a few more times, with more different dump files (each dump file containing specific tables). but never with any luck.

Is there any way to remotely connect to the MySQL instance associated with my Simple Hosting? From where I'm sitting, this appears to be the only way to get my data into the database.

I even went as far as trying to setup replication with a local database server - but that didn't seem to be supported within the Simple Hosting environment.

Answer, by Ryan W.

Encountered exactly this problem with an ~80MB database.My solution was to download BigDump, a PHP script specifically designed to handle large database imports that you upload to a web-accessible directory.

Feed it your MySQL login, provide it with a database (can upload via the script or, ideally, via SFTP into the same directory), and then let it get to work. When exporting your database you must ensure extended inserts are not enabled for this script work, which will increase your dump size but make it much more reliably importable.

This will take a long time — my database required about an hour — but unlike phpMyAdmin it'll get the job done. phpMyAdmin seriously struggled with large databases regardless of the platform, I had just as many problems with a VPS and had to use SSH in that case.

Answer, by Christian W.

As far as I know, there's only access to database via web. No SSH.

How did you zip it? Did you remember to name it filename.sql.zip? (with emphasis on .sql.zip)

Last modified: 20 Mar 2012 at 01:01 by Ryan W.