1. 背景 在 mysql 中 insert 数据的时候,遇到报错信息: The value specified for generated column 'test_字段' in table 'test_表名' is not allowed. 2. 问题原因 查看 sql 的 DDL,该 test_字段 设置了生成条件,不需要给指定的值,所以报错。 'test_字段' char(7) GENERATED ALWAYS AS (date_format