MySQL Column cannot be null

Closed
MeizaelRane Posts 1 Registration date Wednesday March 11, 2015 Status Member Last seen March 11, 2015 - Mar 11, 2015 at 09:29 AM
Ealhsige Posts 1 Registration date Wednesday March 18, 2015 Status Member Last seen March 18, 2015 - Mar 18, 2015 at 11:25 AM
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 March 18, 2015 Status Member Last seen March 18, 2015 3
Mar 18, 2015 at 11:25 AM
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)
3