How to import mysql data in excel-php Tutorial

Source: Internet
Author: User
I used php + excel to import mysql data to excel. I have a total of 351901 data records in excel, but why is there only 16000 data records imported to the database each time, the remaining data must be re-imported. how can I set the number of imported items.


Reply to discussion (solution)

Here is a stupid method:
Divide your excel file into N files, each of which should not exceed 16000 lines. import files one by one

You need to see what causes the interruption.
Is there a processing limit for your excel class?
Is your php memory too large?

Database import size settings? Is mysql 2 M by default?

It is estimated that your php execution times out.

Add set_time_limit (0) to the first line on the php page.

It is not ruled out that 16,001st data entries are faulty.

I personally think it is a problem with mysql settings, and the number of imports is limited.

We recommend that you use sqlyog or other navicat to import data. Very convenient.

Check whether the execution time of your SQL statement times out by default.

I changed the PHP configuration. now, thanks.

Hello, you have not used php to import excel to mysql. please send me one. thank you.

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.