Home >Database >Mysql Tutorial >How to Fix Timeouts When Importing Large SQL Scripts in phpMyAdmin?

How to Fix Timeouts When Importing Large SQL Scripts in phpMyAdmin?

Barbara Streisand
Barbara StreisandOriginal
2024-10-31 03:23:01395browse

How to Fix Timeouts When Importing Large SQL Scripts in phpMyAdmin?

Troubleshooting Timeouts in phpMyAdmin SQL Script Imports

When attempting to import large SQL scripts (exceeding 300 MB) into phpMyAdmin, users may encounter timeout errors despite adjusting settings in their php.ini file. The following steps can help resolve this issue:

Step 1: Verify php.ini Settings

Ensure that the following PHP settings have been modified appropriately in php.ini:

  • post_max_size and upload_max_filesize: Configured to a value greater than the script size (e.g., 750 MB).
  • max_execution_time: Extended to accommodate the estimated time for importing the script (e.g., 300 seconds).
  • max_input_time: Set to a value longer than max_execution_time (e.g., 540 seconds).
  • memory_limit: Allocated sufficient memory for processing the script (e.g., 1000 MB).
Step 2: Modify config.default.php

In case the problem persists, navigate to the file phpmyadminlibrariesconfig.default.php. Locate the line:

  • $cfg['ExecTimeLimit'] = 300;

Modify the value to:

  • $cfg['ExecTimeLimit'] = 0;

This change effectively removes the execution time limit for importing the script.

Reminder: This change should only be applied on local servers for security reasons.

After implementing these modifications, restart phpMyAdmin to apply the updated settings. This should resolve the timeout errors and allow you to import large SQL scripts successfully.

The above is the detailed content of How to Fix Timeouts When Importing Large SQL Scripts in phpMyAdmin?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn