Cloud Service >> Knowledgebase >> WHM >> How to Increase Upload Size for MySQL Database via WHM?
submit query

Cut Hosting Costs! Submit Query Today!

How to Increase Upload Size for MySQL Database via WHM?

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

Log into WHM

Navigate to `https://yourserverip:2087` in your web browser. 

Enter your username and password to access the dashboard.

Access the PHP Configuration Editor

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.

Modify PHP Settings

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.

Steps to Modify These Settings

Basic Mode

  If you are in Basic Mode, look for fields labeled: 

`upload_max_filesize,` 

`post_max_size,` 

`max_execution_time.`

Enter the desired values.

Advanced Mode

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

Save Changes

After making the necessary adjustments, click the "Save" button to apply the changes.

Adjust MySQL Import Settings in phpMyAdmin

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.

Locate the phpMyAdmin Configuration File

   - The configuration file is usually located at `/usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/config.default.php`

   

Edit the Configuration File

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

Save and Close

After making the changes, save the file and exit the editor.

Restart Apache

You may need to restart the Apache web server to ensure all changes take effect. This can be done via WHM:

Navigate to "Restart Services

In the WHM dashboard, find the "Restart Services" section.

Select "HTTP Server (Apache)

  - Click on this option to restart Apache. Confirm the action when prompted.

Verify Changes

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.

Check via phpMyAdmin

Log into phpMyAdmin and navigate to "Server" settings. 

Under the "PHP" tab, look for: 

`upload_max_filesize`

`post_max_size` 

Create a PHP Info File

  - 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.

To Sum it Up!

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.

Cut Hosting Costs! Submit Query Today!

Grow With Us

Let’s talk about the future, and make it happen!