Mysql date assignment method to null: First connect to the MySQL server through the client, use the use keyword to complete the database selection operation; then create a table and insert NULL into the date data type in the time field.
Mysql date assignment method to null:
1. First connect to the MySQL server through the client, example:
mysql -u user -p
2. Use the use keyword to complete the database selection operation. Example:
use database name;
3. Create a simple table in which the date time format supports NULL assignment. Example:
create table user( id int(10) auto_increment primary key, time date);
4. Think of the time field Insert a NULL into the date data type in, example:
insert into user (time) values (null);
5. Check, a NULL is successfully inserted into the Date data type, example:
select * from user;
More related free learning recommendations: mysql tutorial(video)
The above is the detailed content of How to assign null to mysql date. For more information, please follow other related articles on the PHP Chinese website!