gpt4 book ai didi

mysql - 如何将 MySQL 服务器时区设置为 UTC?

转载 作者:行者123 更新时间:2023-11-29 01:21:28 26 4
gpt4 key购买 nike

我已将此行 default_time_zone='+00:00' 添加到 /etc/my.cnf 中,但在重新启动服务器时出现此错误消息:

error: Found option without preceding group in config file: /etc/my.cnf

更新

# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

default_time_zone = "+00:00"

# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306

最佳答案

将它从 default_time_zone 更改为 default-time-zone= 并将其放在 cnf 的 [mysqld] 部分

关于mysql - 如何将 MySQL 服务器时区设置为 UTC?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23570570/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com