Importing large SQL file via phpMyAdmin

October 2016


I have a concern with PHPMyAdmin and my server,

to tell the story: I create a server (well I try) locally by importing a *. sql . Everything worked correctly, so to enjoy it with friends, I said why not host it on the Internet.

Then I buy a small cheap web hosting, and when to import my *. sql file, I see that the most you can import into phpMyAdmin is about 8mo gold do my 32MB file.

So I see two possible solution is to give that I know almost nothing in php : I either cry over my fate I'm asking for is assistance. So I ask for help.

I saw on some other forum and gave the command line and that was the miracle solution but what is good and orders or return?

That is the problem, if anyone has a solution, a tutorial (for novice in php, but rather experiment with computer )? thank you in advance, hoping I was clear and without too many mistakes.


Importing a large file from the command line is simple:
#mysql -p... -u... -h... database_name < file.sql 

Eg with the user "root", password "test" database name "mydb":
#mysql -ptest -uroot my_db < file.sql

I'd be surprised that your host you allows access from the command line, especially if it's a shared hosting ...
In this case, you have no choice but to do so via the interfaces provided, either phpMyAdmin or another.

At last you can also cut your file. sql in 4: you just have to cut any line insert after ending.


Thanks to dam75 for this tip.

Related :

This document entitled « Importing large SQL file via phpMyAdmin » from CCM ( is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.