Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

mysql

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?

EDIT:

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:

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

Thanks in advance.

like image 246
Fero Avatar asked Jul 09 '10 07:07

Fero


1 Answers

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.

like image 155
DrColossos Avatar answered Oct 10 '22 00:10

DrColossos