Technical guide to bypassing PHP upload and execution limits during large database imports in cPanel using phpMyAdmin, compression, and MultiPHP INI adjustments.
phpMyAdmin: Handling Large Imports and Execution Limits
Importing large .sql files via phpMyAdmin frequently fails due to server-level PHP configuration limits. phpMyAdmin is a PHP application; therefore, it is bound by upload_max_filesize, post_max_size, and max_execution_time directives. This guide covers the exact methods to bypass these HTTP-based bottlenecks in the Hovixa cPanel environment.
1. The Compression Strategy (Optimal for Files < 500MB)
Raw .sql files are plaintext and highly compressible. Before modifying server configurations, compress your database dump. phpMyAdmin natively supports extraction during the import process.
- Supported Formats:
.zip,.gzip,.bzip2. - Compression Ratio: A 200MB
.sqlfile typically compresses to roughly 20-30MB, immediately bypassing standard 50MB default upload limits.
2. Modifying PHP Limits via MultiPHP INI Editor
If the compressed archive still exceeds the upload limit, or if the import process times out (Error 504 or blank white screen), you must increase the PHP resource limits for your specific cPanel account.
Configuration Steps:
- Log in to cpanel.hovixa.com.
- Navigate to the Software section and select MultiPHP INI Editor.
- Select your primary domain from the dropdown menu (or configure the Basic Mode for the specific location).
- Modify the following directives to accommodate your file size:
upload_max_filesize: Set higher than your file size (e.g.,512M).post_max_size: Must be equal to or greater thanupload_max_filesize(e.g.,512M).memory_limit: Set higher thanpost_max_size(e.g.,1024M).max_execution_time: Increase to prevent timeouts during query execution (e.g.,300or600seconds).
- Click Apply. These changes take effect immediately.
Security Note: Revert these limits to their defaults (e.g., 2M upload, 30s execution) after a successful import to prevent malicious actors from exhausting server resources via arbitrary file uploads.
3. Executing the Import via phpMyAdmin
- Open phpMyAdmin from the cPanel Databases section.
- Select the target database from the left-hand navigation tree. (Do not skip this step, or the import will fail with a "No database selected" error).
- Click the Import tab.
- Click Choose File and select your
.sqlor compressed archive. - Leave the format as SQL and click Import. Do not close the browser tab until the success message renders.
4. The SSH/CLI Alternative (Mandatory for Massive Databases)
Attempting to import databases exceeding 1GB via an HTTP browser session (phpMyAdmin) is structurally flawed and prone to failure due to browser timeouts and network instability. The analytically correct approach for massive databases is using the MySQL Command Line Interface via SSH.
Execution Steps:
- Upload your
.sqlfile to your cPanel home directory (e.g.,/home/username/) via FTP or the File Manager. - Connect to your Hovixa account via SSH.
- Execute the following command, replacing the variables with your actual database credentials:
mysql -u cpaneluser_dbuser -p cpaneluser_appdb < /home/username/database_dump.sql - Enter the database user's password when prompted.
This method circumvents PHP entirely, operates directly on the MySQL daemon, has no artificial file size limits, and is immune to HTTP timeouts.