Coding starts here
Home / Blog

How to import large sql database file in phpMyAdmin on shared hosting?

As a web developer, sometimes you develop a medium sized website with lots of data ( hundreds of mbs or a few gigs ) but having low budget from your clients end, website is hosted on shared cheap server where “upload_max_filesize” and “max_execution_time” are limited. When you move from your staging server to production server, importing database may give you headaches. As a solution, you may try to upload large tables separately or use any database splitter software but it also takes a lot of time and have to maintain a lot file orders.

Here I am sharing a nice solution on how to import large sql database file in phpMyAdmin on shared hosting.

  1. First, download a copy of phpMyAdmin from here. Then extract it your web root and immediately change the folder name with uncommon name or you may password protect the folder.
  2. Enter into the folder and copy the file named “config.sample.inc.php” and paste in that place with “config.inc.php”.
  3. Now create a folder named “downloads”.
  4. Edit “config.inc.php” and search for $cfg[‘UploadDir’] = ”;. Replace this with $cfg[‘UploadDir’] = ‘uploads’;
  5. Then login in phpMyAdmin and select the database. Next go to import tab and you can find a new radio option appeared here as “Select from the web server upload directory uploads/:“.
  6. Upload your exported sql file and “uploads” folder and import the file. Done.

Share some comments here if you have got any error.

Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x