Page 1 of 1

Importing file that is almost 30 MB

Posted: Thu Apr 12, 2007 6:44 pm
by arya6000
Hello

I have a huge database thats about 30 MB, I used phpMyAdmin to export the database. But when I want to import it the max file is only 8MB even tho I put 30 MB in php.ini. Is 8 MB the Maximum of php upload limit? How can I import this database if I can't do it with phpMyAdmin?


Thank You

Posted: Thu Apr 12, 2007 6:48 pm
by RobertGonzalez
It is probably the database limit. There is a server variable called max_file_size for imports in mysql. You might need to mess with your my.cnf to get it to work, or chop up the file into smaller bits.

Posted: Thu Apr 12, 2007 6:49 pm
by RobertGonzalez
Oh yeah, I am moving this to Databases.

Posted: Thu Apr 12, 2007 6:56 pm
by Benjamin
Do you have ssh access? If so just use the mysql import utility. Otherwise there are two places in php.ini where you need to change the upload file size.

Re: Importing file that is almost 30 MB

Posted: Thu Apr 12, 2007 7:06 pm
by aaronhall
arya6000 wrote:I have a huge database thats about 30 MB, I used phpMyAdmin to export the database. But when I want to import it the max file is only 8MB even tho I put 30 MB in php.ini. Is 8 MB the Maximum of php upload limit?
The restriction actually is imposed by PHP, and if I remember correctly, it was both upload_max_filesize and memory_limit that needed to be adjusted. Go with the import utility that astions suggested if you can, though.

Posted: Thu Apr 12, 2007 7:15 pm
by Benjamin
Don't forget about post_max_size.

Posted: Thu Apr 12, 2007 7:20 pm
by aaronhall
You ahhh correct, sir

Posted: Thu Apr 12, 2007 7:29 pm
by John Cartwright
I've had success with bigdump in the past

Posted: Thu Apr 12, 2007 7:45 pm
by RobertGonzalez
I am telling you this is a mysql server variable thing. I ran into this when trying to load a 50K record zip code table. It might be related to file size in PHP, but there is going to be an issue with the size in mysql as well.

Try breaking it into smaller chunks, or do as jcart suggested and use bigdump (which does the breaking up for you).

Posted: Fri Apr 13, 2007 7:16 am
by Begby
Use the command line utility to import it

mysql -u user -h 67.32.121.23 -p -e "source /path/to/file/dump.sql"


Replace the ip with the IP or URL of your db server. Use localhost if running this on the server.

If your db server allows remote connections to mysql then you could do the above on your local PC. 30mb really isn't that big and would import fine over the net.