MySQL Column cannot be null

Closed
MeizaelRane Posts 1 Registration date Wednesday 11 March 2015 Status Member Last seen 11 March 2015 - 11 Mar 2015 à 09:29
Ealhsige Posts 1 Registration date Wednesday 18 March 2015 Status Member Last seen 18 March 2015 - 18 Mar 2015 à 11:25
Hello, i am running MySQL 5.5 with MyISAM engine in use. Recently i created a table with some columns and everytime i try to add a null into one of the columns, i am getting an error: error 1048 - Column 'xxx' cannot be null
I have tried to change in settings the value for this column, but this does not work. How can i change the value and set 'null' for the columns?


Related:

1 response

Ealhsige Posts 1 Registration date Wednesday 18 March 2015 Status Member Last seen 18 March 2015 3
18 Mar 2015 à 11:25
Check "SQL_MODE='STRICT_TRANS_TABLES';" exist in your my.ini
ALTER TABLE mytable MODIFY quantity NUMERIC(20, 2)
Replace NUMERIC(20, 2) with your actual datatype, but without NOT NULL constraint.
To show your current column definitions, run
SHOW CREATE TABLE mytable
in mysql (the command line client)