Navratri Festive Offer: 50% Off Cloud Hosting + FREE Migration Get It Now!
Extending the max file size for a MySQL database through WHM is a process many web administrators and developers may need to perform frequently when importing massive databases or working with extensive data. WHM has some advantages, such as offering a convenient environment for managing server configurations. It includes PHP settings that can influence the maximum upload size.
Here’s a detailed guide on how to increase the upload size for a MySQL database via WHM:
Step-by-Step Guide to Increasing Upload Size for MySQL Database via WHM
Navigate to `https://yourserverip:2087` in your web browser.
Enter your username and password to access the dashboard.
You'll need to modify the PHP settings to adjust the upload size. These settings control various aspects of file uploads, including the maximum upload size. You can access these settings through the PHP Configuration Editor.
In the WHM dashboard, scroll down or use the search bar to find the "Service Configuration" section.
Click on this option to open the editor.
Within the PHP Configuration Editor, you can adjust various settings. To increase the upload size, you'll need to modify three key parameters:
upload_max_filesize
This setting controls the maximum size of an individual file that can be uploaded.
post_max_size
This setting defines the maximum size of all POST data, which includes the uploaded files.
max_execution_time
This setting sets a script's maximum time in seconds before the parser terminates it. Increasing this can be helpful for large uploads.
If you are in Basic Mode, look for fields labeled:
`upload_max_filesize,`
`post_max_size,`
`max_execution_time.`
Enter the desired values.
Switch to Advanced Mode if you need more detailed control or the settings are not visible in Basic Mode.
Locate the:
`upload_max_filesize,`
`post_max_size,`
`max_execution_time` directives.
Adjust the values directly, for example:
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
After making the necessary adjustments, click the "Save" button to apply the changes.
You might need to adjust additional settings if you are using phpMyAdmin to import your MySQL database. These adjustments ensure that phpMyAdmin recognizes the new upload limits.
- The configuration file is usually located at `/usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/config.default.php`
Use a text editor like `nano` or `vi` to open the file:
/usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/config.default.php
- Find the following lines and adjust them to match your new settings:
$cfg['ExecTimeLimit'] = 300; // Match with max_execution_time
$cfg['UploadDir'] = ''; // Ensure this is correctly set
$cfg['SaveDir'] = ''; // Ensure this is correctly set
After making the changes, save the file and exit the editor.
You may need to restart the Apache web server to ensure all changes take effect. This can be done via WHM:
In the WHM dashboard, find the "Restart Services" section.
- Click on this option to restart Apache. Confirm the action when prompted.
Finally, verifying that the changes have been applied successfully is essential. You can check the PHP configuration in phpMyAdmin or create a PHP info file.
Log into phpMyAdmin and navigate to "Server" settings.
Under the "PHP" tab, look for:
`upload_max_filesize`
`post_max_size`
- Create a file named `info.php` in your web directory with:
phpinfo();
?>
Access this file in your web browser. Ensure that `upload_max_filesize` and `post_max_size` reflect your new settings.
Ensure that phpMyAdmin is configured properly. Check the new settings and ensures they are effective by restarting Apache and verifying the changes so one can easily manage MySQL databases.
Let’s talk about the future, and make it happen!