PHP files with insert100M or above in MySQL

Source: Internet
Author: User
PHP sends a local file to an insert100M file in MySQL to the web server using ajax, and the backend sends the received file to MySQL through PHPinsert.
When the file size is smaller than MB, the insert operation can be successful. when the file size is greater than MB, the PHP program will stop when it moves to the insert operation,
The subsequent code is not executed, and the program will not report an error.


Reply to discussion (solution)

Timeout!
Can't you cut the file into small pieces and insert them separately?

It is not ruled out that your file is not uploaded successfully.

Timeout!
Can't you cut the file into small pieces and insert them separately?


Will no error be reported if the timeout occurs? My files are directly inserted into the MySQL table.

The time required for database operations is not counted within the php runtime. Therefore, php does not necessarily report an error when the overall timeout occurs.

The time required for database operations is not counted within the php runtime. Therefore, php does not necessarily report an error when the overall timeout occurs.


Php I set never Times out... How?

The web server also has a timeout problem.

The web server also has a timeout problem.


The IIS server is set to 5000 seconds, and the actual execution time of the program cannot exceed 15 minutes

The data is too big. you should try another method.

Paste the code to see it.

The file is not successfully written. you can view the server logs.

Points? Ratio? Okay, or use ftp first? To the server? And then? Insert Row

Points? Ratio? Okay, or use ftp first? To the server? And then? Insert Row


Dare to ask how to partition! I have never done file upload! Why do I use ftp to upload files! Is normal Upload slow? Another question is, can php call ftp for uploading? Why does the database still exist when I upload the file to the server?

Isn't it good to store such a large file directly to the disk?

The database is busy.

The database is busy.

Http://goobbe.com/questions/1363628/how-to-save-large-files-in-mysql-database
Save a path to the database.

Finally, you can solve this problem by modifying some attributes in the MySQL configuration file.

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.