Technology Blog



Large SQL imports in phpMyAdmin (LINUX server)

PhpMyAdmin is a very popular graphic interface for SQL servers. One of the problems I encountered when I was starting to work with it, was the (Max: 2,048KiB) file size restriction for choosing a file to import.  


Of course there are multiple ways to import a large SQL file into your server, but on this tutorial, we are going to be doing it with phpMyAdmin’s upload directory.   



  • This tutorial assumes you have phpMyAdmin already installed on your server. 
  • We are going to be working on an Ubuntu 14 server so the directory paths might differ from your server but the premise doesn’t change. 
  • You are going to need ssh access into the server, and super user privileges to modify files and directories. 
  • Please try this on a local or test environment before you go and do it on the production server.


  •  phpMyAdminはすでにインストールされている
  • このチュートリアルでUbuntu14のサーバーを使っているのでディレクトリのパスが皆さんのと違うかもしれませんがやることが変わりありません。
  • サーバーにSSHアクセスとスーパーユーザーの権利が必要です。
  • プロダクションサーバーで実装する前にテスト環境で試してみてください。

Step 1 

Create an upload folder in the phpmyadmin directory. In our case its /etc/phpmyadmin 


$sudo mkdir /etc/phpmyadmin/upload 


Step 2  

Give write permissions to the necessary users. We are going to be giving permission to all users but some people might want to be more specific here. 


$sudo chmod a+w /etc/phpmyadmin/upload 


Step 3 

Open the configuration file on a text editor. (We are using nano, but any editor should be fine) 


$sudo nano /etc/phpmyadmin/ 

Navigate the file until you find the following line


$cfg['UploadDir'] = '';   

and edit it to  the following


$cfg['UploadDir'] = '/etc/phpmyadmin/upload';

Save and exit the editor. 



And that’s all the setup you are going to need. To make sure everything is working correctly, you can log in to phpMyAdmin ad go to the Import tab. Under the Browse your computer option the new Select from the web server upload directory /etc/phpmyadmin/upload/: option should be available to you now.  


Now all you have to do is place the SQL file you want to import inside that upload directory and the file will show up in the drop-down for you to select.