I\'m running MySql
in ubuntu 10.10
. I created a table called \'employee\'
having 3 field names empno, name and salary
I don't see the problem, you set the column to NOT NULL
, (which doesn't allow NULL values) and now it won't let you set it to NULL
, which would be the expected behaviour.
The reason you have 0s in your DB is because 0 would be the result of casting NULL to an int.
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
.