NULL vs DEFAULT NULL vs NULL DEFAULT NULL in MYSQL column creation?

There is no difference. NULL DEFAULT NULL is the implicit default.

From the CREATE TABLE documentation:

  • If neither NULL nor NOT NULL is specified, the column is treated as though NULL had been specified

From the “Data Type Default Values” chapter:

  • If a column definition includes no explicit DEFAULT value, MySQL determines the default value as follows: If the column can take NULL as a value, the column is defined with an explicit DEFAULT NULL clause.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)