Off topic:create a mysql table with repetitive key values
0
0
Entering edit mode
7.9 years ago
ahmedakhokhar ▴ 150

Question: (I am learning MySQL and PHP) I want to create a MySQL table with repetitive primary keys on mac system.

I have CSV file like following with over 1000 rows;

a;1;bit;4

a;3;bit;7

b;1;bit;1

b;2;bit;10

b;4;but;1

and I tried following commands:

create table new ( P VARCHAR(8) int NOT NULL AUTO_INCREMENT primary key, P VARCHAR(8), Pposition VARCHAR(30), Ptype VARCHAR(30)) ENGINE=InnoDB;

load data local infile '/Users/admin/Desktop/ab.csv' INTO TABLE new COLUMNS TERMINATED BY';';

Query OK, 1 row affected, 1 warning (0.03 sec)

Records: 1 Deleted: 0 Skipped: 0 Warnings: 1

Can you please suggest me the right and efficient way to solve this problem. Thanks !

msql • 970 views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 1609 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6