eeolivier
asked on
Import data - Problem with autoincrement field
Hi.
Let's say i have TABLE-1 in mysql-server1 with 2 columns :
id PRIMARY auto-increment.
name TEXT
In TABLE-1 i have 2 rows
id name
1 JOHN
2 MIKE
If i make an export of TABLE-1 in mysql-server2 with mysqldump, i get a file that contain
INSERT INTO TABLE-1 VALUES (1,'ROBERT');
INSERT INTO TABLE-1 VALUES (2,'JASON');
How could I do to import data from mysql-server2 without having problem with "DUPLICATE KEY" of id.
Can i get this export with mysqldump, typing a specific option ?? : (that would solve my problem)
INSERT INTO TABLE-1 VALUES ('','ROBERT');
INSERT INTO TABLE-1 VALUES ('','JASON');
Or do i need to do something while importing.
My real world table have many columns and about 600Mb of data, so i need an adapted solution.
Thanks
Let's say i have TABLE-1 in mysql-server1 with 2 columns :
id PRIMARY auto-increment.
name TEXT
In TABLE-1 i have 2 rows
id name
1 JOHN
2 MIKE
If i make an export of TABLE-1 in mysql-server2 with mysqldump, i get a file that contain
INSERT INTO TABLE-1 VALUES (1,'ROBERT');
INSERT INTO TABLE-1 VALUES (2,'JASON');
How could I do to import data from mysql-server2 without having problem with "DUPLICATE KEY" of id.
Can i get this export with mysqldump, typing a specific option ?? : (that would solve my problem)
INSERT INTO TABLE-1 VALUES ('','ROBERT');
INSERT INTO TABLE-1 VALUES ('','JASON');
Or do i need to do something while importing.
My real world table have many columns and about 600Mb of data, so i need an adapted solution.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.