首页 » 网站推广 » phpmysqldatetime时区技巧_MySQL时区设置总结参数system_time_zone和time_zone

phpmysqldatetime时区技巧_MySQL时区设置总结参数system_time_zone和time_zone

访客 2024-12-19 0

扫一扫用手机浏览

文章目录 [+]

The system time zone. When the server starts, it attempts to determine the time zone of the host machine automatically and uses it to set thesystem_time_zone system variable. The value does not change thereafter.

02全局参数time_zone

用来设置每个连接会话的时区,默认为system时,利用全局参数system_time_zone的值。

phpmysqldatetime时区技巧_MySQL时区设置总结参数system_time_zone和time_zone

The current time zone. This variable is used to initialize the time zone for each client that connects. By default, the initial value of this is 'SYSTEM' (which means, “use the value of system_time_zone”).

phpmysqldatetime时区技巧_MySQL时区设置总结参数system_time_zone和time_zone
(图片来自网络侵删)
03参数log_timestamps

用于设置Error Log/Genaral Log/Slow Log这三种日志的韶光信息。

有效值为UTC(默认)和SYSTEM(本地系统时区),当设置为system时,会利用参数system_time_zone的值。

04修正参数time_zone

# 启动命令--default-time-zone=timezone# 配置文件default-time-zone=timezone# 运行期间set global time_zone='+8:00';

查看操作系统时区

#利用date命令date +\公众%Z %z\"大众date -R## 利用timedatectltimedatectl|grep \"大众Timezone\"大众## 查看文件 /etc/timezonecat /etc/timezone

ps:如果无法修正操作系统时区,又希望数据库利用其他时区,则可以利用参数time_zone来修正。

后面会分享更多devops和DBA方面的内容,感兴趣的朋友可以关注一下~

标签:

相关文章

php常量率低技巧_PHP 常量详解教程

PHP 常量常量是单个值的标识符(名称)。在脚本中无法改变该值。有效的常量名以字符或下划线开头(常量名称前面没有 $ 符号)。注释...

网站推广 2024-12-19 阅读0 评论0