When the primary key is imported, a large number of errors will be reported.
INSERT INTO `FNDCN_ MNG ` values (787390578, 1, ‘Yang Ming’, 95585, ‘2015-06-08′,’prospectus’, 80100, null, ‘1’, null, ‘3’, 2015-06-29 ‘, null,’ 1 ‘,’yang Ming, master of Central University of Finance and economics, 14 years of banking and fund experience. He worked as a credit officer, trader and risk manager in Bank of Shanghai. In October 2004, he joined Huaan Fund Management Co., Ltd. as a researcher of research and development department. Since June 2013, he has been the fund manager of Huaan strategic preferred equity fund. He has been the senior director of investment research since June 2014. ‘, ‘2015-11-09 12:33:58’, ‘2016-01-06 21:34:41’, ‘2015-12-31 12:14:18’, ‘JY’, ‘488969752640’, NULL, NULL, NULL, NULL)
Error occured at:2016-02-16 15:23:41
Error Code: 1062 – Duplicate entry ‘95585-80100-2015-06-29 00:00:00-1–1’ for key ‘IDX_ FNDCN_ MNG’
Set the primary key to grow automatically. You can manually set the related table ID to self growing in the database.
As shown in the figure:
Continue to import normal.
Problem Description: if the SQL is imported separately, the following error will be reported:
1 queries executed, 0 success, 1 errors, 0 warnings
Query: insert into ` fndcn_ MNG ` values (787192513, 1, ‘Dingjin’, 150150, ‘2015-12-28’, ‘prospectus’, 80100, null,’ 1 ‘, null,’ 3 ‘, 20
Error code: 1062
Duplicate entry ‘787192513’ for key ‘PRIMARY’
After checking, the primary key generation strategy is: @ generatedvalue (strategy)= GenerationType.IDENTITY ）No problem.
Delete the table with import error;
Create a new table to import data;
My problem is in the database: in the database, the primary key is not set to grow automatically. Set the primary key of the existing table to grow automatically. The SQL statement is as follows:
alter table course change course_ id course_ id int(10) not null auto_ increment ;
Then use SQL script to import the required data, which can also easily locate errors.
- Solution of duplicate entry ‘value’ for key ‘field name’ in MySQL
- Txt import MySQL: error 1062 (23000): duplicate entry ‘0’ for key ‘primary’
- mysql error 1062
- [reprint and save] MySQL does not set the primary key and uses the self growing ID method
- The solution of Hibernate query returning all null lists
- 1822 – Failed to add the foreign key constraint. Missing index for constraint ‘tb_emp_ibfk_1’ in the
- MySQL operation and maintenance slave_ skip_ errors
- MySQL partitions the existing tables of the data table
- javax.persistence.EntityNotFoundException : unable to find error
- E11000 duplicate key error collection in mongodb
- Error 3002: Problem in mapping fragments | c# linq to entities
- Modification method of starting value of MySQL auto increment ID
- How to make the import complete smoothly!
- DB2 create table error – 104 42601 illegal symbol encountered in SQL statement
- greendao insert data UNIQUE constraint failed: PURCHASE_ORDER_TABLE._id (code 1555)
- django.db.utils .IntegrityError: NOT NULL constraint failed: blog_ blog.author_ ID error resolution
- MySQL error: can’t create table ‘..’（ errno:150 ）Solutions
- ORA-00907:missing right parenthesis
- Datagrip import & export table structure and data
- MySQL:Foreign key fails with error Error Code: 1452.