Search Our Database

How to set upload limit in phpMyAdmin

Last updated on |

Introduction

phpMyAdmin is a popular web-based tool used to manage MySQL or MariaDB databases through a graphical interface. One of its core features is the ability to import database files — such as .sql backups — directly from your local system. However, by default, phpMyAdmin inherits file upload limits from PHP’s configuration, which can be quite low (often 2MB). This guide walks you through the steps to check and modify the necessary settings to increase the file upload limit in phpMyAdmin — ensuring your large SQL files can be imported without issues.

 

Prerequisites

  • SSH access to the server as root. If you access the server as non-root user, kindly switch to root with sudo su
  • Basic knowledge of file editing in Linux

 

Step 1: Locate the php.ini file

  • You can find the php.ini with this command
php -i | grep php.ini
Configuration File (php.ini) Path => /usr/local/php73/lib
Loaded Configuration File => /usr/local/php73/lib/php.ini
Note : In this example, the path for php.ini is /usr/local/php73/lib/php.ini
  • Once you confirmed the path, open the file with your desired text editor. In this guide, we will be using vi /usr/local/php73/lib/php.ini

 

Step 2: Adjust the parameters

  • Inside php.ini, there are a few parameters that are suggested to be adjusted in order to increase file upload limit in phpMyAdmin
  • upload_max_size: Sets the maximum size of a single uploaded file. If a file exceeds this size, PHP will reject it.
  • post_max_size: Sets the maximum size of the entire HTTP POST request.
Note : post_max_size must be more than upload_max_size
  • memory_limit: Defines the maximum amount of memory a single PHP script can use. This parameter matters to prevent runaway scripts from consuming all available RAM.
  • max_execution_time: Sets the maximum time (in seconds) a PHP script is allowed to run. This is to prevent long-running scripts from hanging the server.
  • max_input_time: Sets the maximum time PHP spends parsing input data. If PHP takes too long to parse large form data or files, it will stop.
  • This is the example setup to set the upload limit to 64Mb
upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 128M
max_execution_time = 30
max_input_time = 60

 

Step 3: Test it out

  • You may test it out on phpMyAdmin web interface. From the website, we can see the upload limit has been set to 64Mb


 

Conclusion

Increasing the upload limit in phpMyAdmin is essential when working with large database files. By properly adjusting the relevant PHP settings — and ensuring the correct configuration is being used by your web server — you can remove restrictive size barriers and avoid frustrating upload errors.

Should you have any technical inquiries, feel free to contact us at support@ipservervone.com