MySQL ALTER TABLE add column: error at another column

后端 未结 2 703
南旧
南旧 2021-01-25 22:36

ok, i have people table and try run sql-script with the next command:

ALTER TABLE `people`
    ADD COLUMN `name_spelling`
    VARCHAR(255) NULL DEFA         


        
2条回答
  •  礼貌的吻别
    2021-01-25 23:17

    Maybe your MySQL has some option such as the NO_ZERO_DATE SQL mode (I think it's not the only mysql config that prevents 0000-00-00 dates). This would prevent you from using 0000-00-00 as a value. It happened to me before that I had a table already created violating that condition. It will not be editable until you change the value or disable what's preventing you to set 0 dates.

    For reference :http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html

提交回复
热议问题