Importing file that is almost 30 MB

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
arya6000
Forum Newbie
Posts: 15
Joined: Fri Apr 07, 2006 3:32 pm

Importing file that is almost 30 MB

Post 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
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Oh yeah, I am moving this to Databases.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post 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.
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Re: Importing file that is almost 30 MB

Post 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.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Don't forget about post_max_size.
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

You ahhh correct, sir
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

I've had success with bigdump in the past
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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).
Begby
Forum Regular
Posts: 575
Joined: Wed Dec 13, 2006 10:28 am

Post 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.
Post Reply