MySQLMySQL 1366
MySQL 1366: Incorrect Integer Value
MySQL 1366 is raised in strict mode when a non-numeric string is inserted into an integer column. In non-strict mode MySQL silently truncates to 0, which hides data quality issues.
Example Query
INSERT INTO products (stock) VALUES ('many');
-- 'many' cannot be stored in an INT columnCommon Causes
- 1Application passing a string where an integer is expected
- 2CSV import with header row accidentally included in data rows
- 3Empty string '' passed for a numeric column
How to Fix It
Validate and sanitise application input before passing to SQL. Cast strings to integers explicitly. Enable strict mode (STRICT_TRANS_TABLES) in production to catch these errors early rather than silently corrupting data.
Need a reliable database?
Try Supabase — free PostgreSQL with a generous free tier. No credit card required.
Got a query causing this error?
Paste it into SQLbuddy and get an instant plain-English explanation with optimization tips.
Analyze My Query →