MySQL database appear to import data xls 1062 appeared to solve the main problem from the wrong program error

    Today found 1062 errors when the data table into MySQL database xls, and there are 20-700 pieces of data could not have been imported so start looking for solutions.

Solution 1: database table design problem causes duplication can not import the same field   

        Solution: The primary key is absolutely impossible to duplicate set of data, or the Unique changed to Normal but I tried still can not import those erroneous data. The first attempt failed, some solution to the problem are welcome to try, which is the unique index instead of ordinary index.

Solution 2: Internet, said the id field type wrong, anyway, I probably understand that three kinds of storage methods supported by MySQL int:

  •         TINYINT a small integer, signed range: -128 to 127, unsigned range is 0 to 65535.
  •        SMALLINT a small integer, a signed range is -32768 to 32767, unsigned range is 0 to 65,535.
  •        MEDIUMINT a medium-size integer, a signed range of -32768 to 32767, unsigned range is 0 to 65,535.
  •        INT a normal-size integer, a signed range -2147483648 to 2147483647, unsigned range is 0 to 4294967295.
  •         BIGINT a large integer, is signed range -9223372036854775808 to 9223372036854775807, unsigned range 0-18446744073709551615.

  What he means is probably the cause of cross-border data can not import the data correctly and I tried again, no, the problem still not resolved! And more and more I go wrong, this sucker database.

Solution 3: spade drive and the file is not open, the key is how to install the driver database I will not, but I use Navicat also not installed locally driven ah,

And then I changed a file format that the data in the table are rounded to xls xlsx format and then import the data in the table xlsx, then do not read the tables are being given directly, even I opened the file into a WPS will not work, I'm so tired, so I do the next one office to open xlsx and import and error, and I bored bored back to xls file with the office open again to import again perfect, problem resolved smoothly.

Review Questions: database import xls file error, an exception report 1062. I was forced to Mongolia, the first sub-tables into a few error-free without exception, on the final table being given a lot;

  Solution: Download the office and open the xls file and then import it again. problem solved.

Summary: First of all, I use WPS, the cause of problems is probably the WPS data tables xls file xls files and office data tables behind a few little difference in the table, can happen earlier, abnormal happened after the fifth table. MySQL only supports the format does not support WPS office and several front table so little difference between the two determined introduced. (This summary is for reference only, welcome to correct me !!)

Guess you like

Origin www.cnblogs.com/hhhhhhhhh/p/11505814.html