MySQL Forums
Forum List  »  MySQL Workbench

Error Code: 1366. Incorrect integer value: '' for column 'exercise_id' at row 1
Posted by: Kenny Turano
Date: January 31, 2023 05:32AM

I am new to MySQL. I am trying to upload a CSV file into a table and I cannot get passed this error: "Error Code: 1366. Incorrect integer value: '' for column 'exercise_id' at row 1".

I'm running workbench 8.0.32
my CSV file has the exercise_id column blank, because I want to auto assign the id.

Here are the commands I'm using:


Create table exercises (
exercise_id int AUTO_INCREMENT,
Exercise_name VARCHAR(1000) NOT NULL,
Main_body_part VARCHAR(255) NOT NULL,
Sub_body_part VARCHAR(255) NOT NULL,
Skill_level VARCHAR(255) NOT NULL,
Exercise_Description VARCHAR(1000),
Equipment_needed VARCHAR(255),
PRIMARY KEY (exercise_id)
);
LOAD DATA INFILE 'C:\\ProgramData\\MySQL\\MySQL Server 8.0\\Uploads\\MHFit_Exercise_DB_2023.01.30.csv'
INTO TABLE exercises
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\r\n'
IGNORE 1 ROWS;
select * from exercises;

Options: ReplyQuote


Subject
Views
Written By
Posted
Error Code: 1366. Incorrect integer value: '' for column 'exercise_id' at row 1
2029
January 31, 2023 05:32AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.