Mysql insert for column with enumerated values?

I have an insert that works, until i try to send a field that is type enum. The value that’s being sent is in the enumerated fields in the database. It’s for states, so TN is in the value set and that’s also a value in the ENUM list. However I get this error with n8n when trying to insert:


NodeOperationError: Data truncated for column 'clState' at row 2 at Object.parseMySqlError (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/MySql/v2/helpers/utils.js:74:12) at /usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/MySql/v2/helpers/utils.js:171:47 at processTicksAndRejections (node:internal/process/task_queues:95:5) at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/MySql/v2/actions/database/insert.operation.js:171:18) at Object.router (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/MySql/v2/actions/router.js:53:30) at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/MySql/v2/MySqlV2.node.js:16:16) at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:728:19) at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:660:53 at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1062:20

n8n 1.38.2
self hosted mysql database (n8n is using it’s default)
Docker
Ubuntu 22.04lts

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @tkintenn, could you share the exported JSON for the MySQL node you’re doing this with? You can do so by copy & pasting the workflow JSON content in between two block quotes (```)

Also, it might be helpful if you could share additional info like the following,

  1. The full schema of the table. You can get this by running the following SQL command:
    SHOW CREATE TABLE name_of_table;
    
  2. The exact ENUM definition for the clState column:
    SHOW COLUMNS FROM name_of_table LIKE 'clState';
    

I’m trying to paste the output from mysql and keep getting a 403 error.

clState | enum(‘AL’,‘AK’,‘AZ’,‘AR’,‘CA’,‘CO’,‘CT’,‘DE’,‘DC’,‘FL’,‘GA’,‘HI’,‘ID’,‘IL’,‘IN’,‘IA’,‘KA’,‘KY’,‘LA’,‘ME’,‘MD’,‘MA’,‘MI’,‘MN’,‘MS’,‘MO’,‘MT’,‘NE’,‘NV’,‘NH’,‘NJ’,‘NM’,‘NY’,‘NC’,‘ND’,‘OH’,‘OK’,‘OR’,‘PA’,‘RI’,‘SC’,‘SD’,‘TN’,‘TX’,‘UT’,‘VT’,‘VA’,‘WA’,‘WV’,‘WI’,‘WY’) | YES | | NULL | |

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.