Home >Database >Mysql Tutorial >How to insert null in mysql date
Mysql date insert null method: first connect to the MySQL server; then use the use keyword to complete the database selection operation; finally insert a NULL into the date data type, the code is [insert into user (time) values ( null)].
More related free learning recommendations: mysql tutorial(video)
mysql date method of inserting null:
1. First connect to the MySQL server through the client, example:
mysql -u user -p##2. Use use Keyword, complete the database selection operation, example:
use 数据库名;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. Insert a NULL into the date data type in the time field. Example:
insert into user (time) values (null);5. Query the Date data A NULL was successfully inserted into the type, example:
select * from user;
The above is the detailed content of How to insert null in mysql date. For more information, please follow other related articles on the PHP Chinese website!