You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

将完整phpMyAdmin数据库导入新Windows系统失败的解决求助

Hey there, let's tackle this phpMyAdmin import issue step by step—since you've already tried adjusting the upload size in the .ini file, let's dig into other common culprits and fixes:

1. Double-check you modified the RIGHT configuration files

It's easy to edit the wrong php.ini (there are often separate files for CLI and web PHP). Here's how to confirm:

  • Open phpMyAdmin, scroll to the bottom of the homepage, and look for Configuration file (php.ini) path under the PHP version info—this is the exact file you need to edit.
  • Make sure these parameters are set to values larger than your 127_0_0_1.sql file:
    upload_max_filesize = 64M  # Adjust to match your file size (e.g., 128M if needed)
    post_max_size = 70M        # Must be larger than upload_max_filesize
    max_execution_time = 300   # Extend timeout for large imports
    max_input_time = 300
    
  • Don't forget to restart your web server (Apache/Nginx) and PHP-FPM (if you're using it) after saving changes—configs won't take effect otherwise.
2. Adjust phpMyAdmin's internal limits

phpMyAdmin has its own restrictions that override PHP settings in some cases:

  • Locate your phpMyAdmin config.inc.php file (usually in the phpMyAdmin installation directory).
  • Add or update these lines:
    $cfg['ExecTimeLimit'] = 300;  # Give the import more time to run
    $cfg['MaxAllowedPacket'] = 67108864;  # 64M, matches MySQL's max_allowed_packet
    # Optional: Set an upload directory on your server to bypass HTTP upload limits
    $cfg['UploadDir'] = '/path/to/your/server/folder';
    

If you use the UploadDir trick, just upload your SQL file to that server folder first—phpMyAdmin will let you select it directly from the import page, skipping web uploads entirely.

3. Fix MySQL's max_allowed_packet restriction

Even if PHP and phpMyAdmin allow the file, MySQL might block large data packets:

  • Log into MySQL via command line: mysql -u root -p
  • Check the current value: SHOW VARIABLES LIKE 'max_allowed_packet';
  • If it's smaller than your file size (default is often 1M), edit MySQL's config file (my.ini on Windows, my.cnf on Linux):
    Add this under the [mysqld] section:
    max_allowed_packet = 64M
    
  • Restart the MySQL service, then try importing again.
4. Use the command line for reliable large imports

Web-based tools like phpMyAdmin can hit hidden limits—command line imports are way more stable for big files:

  • Open Command Prompt (Windows) or Terminal (Linux).
  • Run this command (replace placeholders with your details):
    mysql -u your_mysql_username -p your_target_database < "C:\path\to\127_0_0_1.sql"
    
    Note: You need to create the empty target database in phpMyAdmin first before running this.
  • Enter your MySQL password when prompted, and let the import run—this bypasses all web-layer restrictions.
5. Check for errors in the SQL file itself

If all else fails, your dump file might be corrupted or have compatibility issues:

  • Open 127_0_0_1.sql in a text editor and scan for odd characters at the start/end, or syntax errors (e.g., old MySQL keywords that aren't supported in your new version).
  • If the file is massive, split it into smaller chunks using a local tool like SQL Dump Splitter, then import each chunk one by one.

内容的提问来源于stack exchange,提问作者walimbeakshay

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 03:39:00