12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
mysql数据库 时间:2024-12-25 09:56:43
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
一、查看MySQL当前时区和时间show variables like "%time_zone%";#查看时区#time_zone说明mysql使用system的时区,system_time_zone说明system使用CST时区select curtime();#
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
一、查看MySQL当前时区和时间
show variables like "%time_zone%";#查看时区
#time_zone说明mysql使用system的时区,system_time_zone说明system使用CST时区
select curtime();#查看时间select now();#查看日期+时间
二、修改时区
可以通过修改my.cnf配置文件来修改时区
# vim /etc/my.cnf
在[mysqld]区域中添加如下内容:
default-time_zone = '+8:00'
修改完成后,需要重启启动MySQL,配置生效。
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19