Contents
MySQL PHPMyAdmin is a popular web-based database management tool that allows users to interact with MySQL databases through a user-friendly interface. While PHPMyAdmin is a versatile tool, it does come with certain limitations, one of which is the default upload limit for importing databases. In this article, we will guide you on how to increase upload limit in MySQL PHPMyAdmin.
By default, PHPMyAdmin restricts the maximum size of the files you can upload to import databases. This limitation is in place to prevent server resource abuse and to maintain system stability. However, there are scenarios where you may need to import larger database files, and increasing upload limit becomes essential.
Here’s a step-by-step guide to increasing the upload limit in MySQL PHPMyAdmin:
Locate Your PHP Configuration File to Increase Upload Limit
First, you need to locate the PHP configuration file (php.ini) on your web server. The location of this file may vary depending on your server setup. Common locations include /etc/php/7.4/apache2/php.ini
or /etc/php/7.4/cli/php.ini
for PHP 7.4. You may need root or administrator access to modify this file.
upload_max_filesize = 32M
post_max_size = 32M
Modify the upload_max_filesize
and post_max_size
directives to your desired upload limit. Set them to the maximum file size you want to allow for uploads. In this example, it’s set to 32 megabytes (M).
Edit phpMyAdmin’s configuration
Locate the config.inc.php
file within your phpMyAdmin installation directory. This file is typically found in a folder named “config” or “libraries.”
$cfg['UploadDir'] = '';
$cfg['MaxFileUploads'] = 10;
Set $cfg['UploadDir']
to an empty string (”) to allow uploads from any directory.
Adjust $cfg['MaxFileUploads']
to your desired maximum number of file uploads if needed.
Restart Apache
To apply the changes, you need to restart the Apache web server. You can do this with the following command to see the changes we have made for Increase Upload Limit
sudo service apache2 restart
It’s important to note that modifying PHP configuration settings should be done with caution, as it can affect the overall performance and security of your web server. Be sure to make a backup of your php.ini file before making any changes, and only increase upload limit to a reasonable value based on your server’s resources.