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.
- 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.
- Enter into the folder and copy the file named “config.sample.inc.php” and paste in that place with “config.inc.php”.
- Now create a folder named “downloads”.
- Edit “config.inc.php” and search for $cfg[‘UploadDir’] = ”;. Replace this with $cfg[‘UploadDir’] = ‘uploads’;
- 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/:“.
- Upload your exported sql file and “uploads” folder and import the file. Done.
Share some comments here if you have got any error.