Change Upload Size Limit SQL file in phpMyAdmin

Tutorial that teaches you step by step how to change the accepted size limit for importing SQL files in phpMyAdmin. Helpful when you need to import large databases. Change Upload Size Limit SQL file in phpMyAdmin.

When we work with DatabaseMost handy is us , We provide management support bases given eprin web interface. From phpMyAdmin we can make any changes in a database to which we have access. We can add databases, create, delete and edit tables in databases, we can remove or import databases maintained.

In the standard configuration (default) function “Import"In phpMyAdminDoes not allow us to do upload in the files larger 2MB (2,048 KiB). If we need a database larger than 2 MB, then the error occurs: "You probably tried to upload too large file. Please referer to documentation for ways to workaround this limit."

phpMyAdmin SQL Database Upload Big
Upload too large file in phpMyAdmin

One solution would to compress the database (.sql file) in one of the formats gzip, bzip2 or zip, but if the database file is very large, then we certainly do not even compress it to get a file under 2MB that can be scanned by  phpMyAdmin. The only solution is to change the allowed size limit for uploads.

Import SQL files in phpmyadmin
Import .sql file into phpMyAdmin

Change Upload / Import Size Limit in phpMyAdmin

Import limit is given by configuration Site, and to change this limit will have to edit the configuration file responsible for PHP (php.ini).

Depending on the system used, php.ini can be located in "/etc/php.ini","/etc/php5/apache2/php.ini” or in another location on . The easiest way to locate it is to log in to the server (via ) and give the command line "locate php.ini“. After locating the php.ini file, we move on to editing it.

nano /etc/php.ini
Change Upload Size Limit SQL
Change Upload Size Limit SQL

In the file php.ini search and edit the following lines:

max_execution_time = 60 ; Maximum execution time of each script, in seconds (def. 30) 
max_input_time = 90 ; Maximum amount of time each script may spend parsing request data (def. 60) 
memory_limit = 128M ; Maximum amount of memory a script may consume (def. 128mb) 
upload_max_filesize = 200M ; Maximum allowed size for uploaded files. (def. 2mb) 
post_max_size = 180M ; Maximum size of POST data that PHP will accept

In our case we set the maximum size of the file to be imported is not less than 180MB. That means we can import via phpMyAdmin database to 180MB.

Change Upload Size Limit SQL
Change Upload Size Limit SQL

In Funt your needs change execution time and memory limit used. If the times set in php.ini are small and the file to be imported is very large, then it is possible to give the error "time out”The import. For this you will have to change "max_input_time"And"max_execution_time“. This is also true for the memory limit, which must be increased for large databases. After making the changes, using the "nano" editor, click Ctrl + X then “Y”(Yes) yes Enter to save the changes.

The last step is restarting .

systemctl restart httpd 

or

/etc/init.d/httpd restart

After the restart of you can start importing the file with the database.

- Import Size Limit Change in phpMyAdmin.

Founder and editor Stealth Settings, from 2006 to the present. Experience on operating systems Linux (in particular CentOS), Mac OS X, Windows XP> Windows 10 si WordPress (CMS).

How to » Noteworthy » Change Upload Size Limit SQL file in phpMyAdmin

1 thought on “Change Upload Size Limit SQL file in phpMyAdmin”

  1. Old tutorial but still relevant. Thanks a lot!
    However, it does not work in all situations. Connection timed out when uploading.

    Reply
Leave a Comment