For details about mysql notnull, refer to the following SQL & nbsp; ddl statement: password & nbsp; char (32) & nbsp; not & nbsp; null & nbsp; default & nbsp; "", // If md5 is defined, please refer to the not null details of not & nbs mysql.
For example, an SQL ddl statement:
Password char (32) not null default "", // has md5
Since not null is defined, the user must add a password. is the default value later redundant? In addition, the length is set to 32 bits, and the default value is null,
If it is not null, the default value does not exist. even if it exists, its value attribute does not conform to the attribute conventions of the field? Solution! Share:
------ Solution --------------------
On the contrary
When not null, if you do not enter anything, press the default input.
In other words, it is recommended that you set not null to set default.
------ Solution --------------------
Irrelevant!
Password is just a name, it does not make any sense for the database
Not null default "" aims to: if no value is assigned to it, the default value is null. This parameter can be set by default during insertion.
If it is not null only, this item must have a value during insertion; otherwise, an error occurs.
If the password must have a value, it should be defined
Password char (32) not null,
Instead
Password char (32) not null default "",
------ Solution --------------------
Always give a default
------ Solution --------------------
Reference:
Irrelevant!
Password is just a name, it does not make any sense for the database
Not null default "" aims to: if no value is assigned to it, the default value is null. This parameter can be set by default during insertion.
If it is not null only, this item must have a value during insertion; otherwise, an error occurs.
If the password must have a value, it should be defined
Password char (32) not null,
Instead
Password char (32) not null default "",
Your requirements are as follows:
Password char (32) not null
If the default "" is added, the database will store a string with a length of 0 "without passing the value "".
Null! = ""