Home > Database > Mysql Tutorial > How to Import a Large Database File into phpMyAdmin When You Get the 'File Size Too Large' Error?

How to Import a Large Database File into phpMyAdmin When You Get the 'File Size Too Large' Error?

DDD
Release: 2024-11-21 06:04:13
Original
374 people have browsed it

How to Import a Large Database File into phpMyAdmin When You Get the

Error Importing Large Database via phpMyAdmin: "File Size Too Large"

When attempting to import a large database file (in this case, a .sql file of 1.2 GB) through phpMyAdmin, you may encounter the following error message:

You probably tried to upload too large file. Please refer to documentation for ways to workaround this limit.
Copy after login

To resolve this issue and successfully import the large database, follow these steps:

1. Modify php.ini Settings

  • Open the php.ini file located in C:wampbinapacheApache2.4.4bin.
  • Update the following lines:
max_execution_time = 259200
max_input_time = 259200
memory_limit = 1000M
upload_max_filesize = 750M
post_max_size = 750M
Copy after login
  • Restart WAMP Server or all services to apply the changes.

2. Adjust phpMyAdmin Configuration

  • Open the config.default.php file located in c:wampappsphpmyadmin4.0.4libraries.
  • Find the line: $cfg['ExecTimeLimit'] = 300;
  • Replace it with: $cfg['ExecTimeLimit'] = 0;

3. Import Database using MySQL Console

If the first two methods fail, you can use MySQL Console to import the large database file.

  • Click on WAMPServer Icon -> MySQL -> MySQL Consol
  • Enter your database password (e.g., root).
  • Select the database name where you want to import the data using the command: USE DATABASENAME
  • Load the source SQL file using the command: SOURCE C:FOLDERdatabase.sql
  • Press Enter to initiate the import process.

Note:

  • Compressed database files (e.g., database.sql.zip or database.sql.gz) cannot be directly imported and must be extracted first.
  • The MySQL Console import method is often more efficient for handling large databases.

The above is the detailed content of How to Import a Large Database File into phpMyAdmin When You Get the 'File Size Too Large' Error?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template