Solve the problem that large SQL files cannot be imported. phpMyAdmin file size limit

Source: Internet
Author: User

Solution: SQL large files cannot be imported. phpMyAdmin file size limit solution

The batch processing task in navicat for MySQL is often used to import. SQL files with errors and garbled characters.
However, when using phpMyAdmin to import a. SQL file, there is a limit that the start value cannot be greater than 2 MB. Therefore, to change the php. ini parameters, follow these steps to change the parameters and restart them;

Generally, there are no problems with dozens of MB files. I tested MB files locally. SQL files can be imported. if the file size is too large after the INI parameter, the browser will be suspended. We recommend that you increase the memory size and check the hardware support of the machine;
It takes a little longer to wait for a while. You can see that the MySQL nt process is very large in the task manager, so it is generally caused by insufficient memory.
Import has been successfully finished, 2262 queries executed.
This statement indicates that all data has been successfully imported.
The following is the parameter settings for PHP. ini.
1. Open PHP. ini. Find the upload_max_filesize, memory_limit, and post_max_size parameters!
(By default, phpMyAdmin only allows a maximum of 2 MB of data to be uploaded, that is, 2048kb. The maximum memory used for memory_limit is only 128 MB, the maximum value of post is 2 MB)
2. Make the following changes based on the actual performance configuration of your server: (Note: The following changes are made based on the hardware configuration of my server performance ..)
Upload_max_filesize = 8 m (the maximum upload limit is set to 8 m, which should be enough for normal file web uploads)
Memory_limit = 512 M (because the server memory is 2 GB, it cannot be added to m here)
Post_max_size = 8 m (the maximum size of post data is also set to 8 MB, which is the same as upload_max)

1. Modify the $ cfg ['exectimelimmit '] configuration option in the phpMyAdmin config configuration file. The default value is 300. You need to change it to 0, that is, there is no time limit.

2. Modify $ memory_limit on the import page under the phpMyAdmin installation root directory.

Description: PHP is preferred. the memory configuration option memory_limit in the ini configuration file. If it is null, the default memory size is limited to 2 MB. If there is no limit, the memory size is limited to 10 MB. You can combine your php. modify the code in the ini configuration file.
3. After the command is changed, run the import command again:
Import has been successfully finished, 399 queries executed.
(Display how many requests are successfully imported ...)
(Note: After modification, When you import the command line to phpMyAdmin, although (sometimes it may still be displayed as: Maximum: 2048kb/MAX: 2, 048kib ); but you can import the backup files exported from gzip to a database of no more than 8 Mb! After modifying PHP. ini, do not forget to restart the Web service or server! After restart, it becomes effective !)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.