Hi,
I’m importing seed data into a MySQL table and my bulk INSERT fails with multiple errors depending on the row. I suspect some data-cleaning/format issues during copy/paste or CSV → SQL conversion.
Table definition
CREATE TABLE lead_broker_status (
lead_id int(11) NOT NULL,
broker_id int(11) NOT NULL,
status_id int(11) DEFAULT NULL,
followup_datetime datetime DEFAULT NULL,
warmth enum('Hot','Warm','Cold') DEFAULT NULL,
updated_at datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
deleted tinyint(1) DEFAULT 0
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
Insert statement (sanitized sample)
INSERT INTO lead_broker_status
(lead_id, broker_id, status_id, followup_datetime, warmth, updated_at, deleted) VALUES
-- Row 1: MySQL throws ERROR 1064 near part of the numeric id
(101, 4, 1, NULL, NULL, '2025-09-27 03:34:18', 0),
-- Row 2: MySQL throws ERROR 1265 data truncated for enum column
(102, 5, 1, NULL, 'Hot ', '2025-09-27 03:34:25', 0),
-- Row 3: MySQL throws ERROR 1292 incorrect datetime value
(103, 4, 1, NULL, NULL, '2025-09-27 13:05:61', 0);
Errors
ERROR 1064 (18882749655) – syntax error near part of the numeric value
ERROR 1265 (01000) – data truncated for column warmth
ERROR 1292 (22007) – incorrect datetime value for updated_at
What I suspect
For ERROR 1064: one of the numeric IDs in my real dataset may contain a non-printable character (for example a zero-width space U+200B) from copy/paste, which makes the number invalid even though it looks normal.
For ERROR 1265: the value 'Hot ' has a trailing space, so it doesn’t match the ENUM definition exactly.
For ERROR 1292: the timestamp has invalid seconds (61), since seconds must be 00–59.
What I’m asking
Best way to detect and remove non-printable characters in SQL import data (or how to identify them in MySQL/CLI tools).
Best practices for handling ENUM input safely (trim/validate before insert vs changing schema).
Recommended approach to validate/correct datetime values during bulk inserts.
Any MySQL settings (e.g., sql_mode) that can help catch these issues early with clearer feedback.
Environment:
MySQL version: (add your version)
OS: Windows
Tool: (MySQL CLI / phpMyAdmin / Workbench)
Thanks in advance for any guidance on cleaning the data and preventing these errors in future imports.