当前位置: > 其它学习 > 日常运维 >

show variables like 'explicit_defaults_for_timestamp';

时间:2019-04-03 13:32来源:未知 作者:IT

 

mysql> show variables like 'explicit_defaults_for_timestamp';

+---------------------------------+-------+

| Variable_name                   | Value |

+---------------------------------+-------+

| explicit_defaults_for_timestamp | OFF   |

+---------------------------------+-------+

1 row in set (0.00 sec)




mysql> set @@global.explicit_defaults_for_timestamp=on;

Query OK, 0 rows affected (0.00 sec)

 

mysql> set @@session.explicit_defaults_for_timestamp=on;

Query OK, 0 rows affected (0.00 sec)



vi  /etc/my.cnf

explicit_defaults_for_timestamp=true



 

[client]

default-character-set = utf8mb4

 

[mysql]

default-character-set = utf8mb4

 

[mysqld]

character-set-client-handshake = FALSE

character-set-server = utf8mb4

collation-server = utf8mb4_unicode_ci

init_connect='SET NAMES utf8mb4'

explicit_defaults_for_timestamp=true

[root@localhost etc]# 


(责任编辑:IT)
------分隔线----------------------------