Why does MySQL allow to update a NOT NULL column to NULL?

前端 未结 2 429
暗喜
暗喜 2021-01-12 20:07

I\'m running MySql in ubuntu 10.10. I created a table called \'employee\' having 3 field names empno, name and salary

2条回答
  •  情深已故
    2021-01-12 20:47

    You must not have SQL_MODE set to strict on you ubuntu installation.

    Issue

    SET SQL_MODE='STRICT_ALL_TABLES'
    

    or add

    SQL_MODE='STRICT_ALL_TABLES'
    

    under [mysqld] to your my.cnf on Ubuntu.

提交回复
热议问题