Fero Fero - 1 year ago 81
MySQL Question

How to import sql files which are more than 10mb in mysql database

I can't import a sql file that is more than 10 MB.

Is there any way to import a file that's more than 10MB using MYSQL?


I have a mysql dump file which is more than 10MB. I can't import it in my localhost. When i try, the following error occurs:

You probably tried to upload too large file. Please refer to documentation for ways to workaround this limit.

Thanks in advance.

Answer Source

You should to do it via the commandline.

Since you wrote localhost above, I assume you have access. It also has no time limit for importing data.

mysql -u username -p database < location/to/your/dump.sql

-p will ask you for your password. If the user has no password, ignore the flag

edit: @Marco Mariani: This is a possibility, but keep in mind that this limit will be used for ALL of your PHP applications on the same server. You could change it back after the import but that's rather tedious and a high upload limit isn't a good idea IMO.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download