Importing large SQL file via phpMyAdmin

January 2017


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.


Published by aakai1056. Latest update on May 7, 2010 at 09:39 AM by aakai1056.
This document, titled "Importing large SQL file via phpMyAdmin," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (