我想将mysql中的时区从EDT更改为GMT,
SELECT @@system_time_zone;
+--------------------+
| @@system_time_zone |
+--------------------+
| EDT |
+--------------------+
1 row in set (0.00 sec)
关于研究谷歌,我正在打它不可能!我很确定应该是。
对于当前会话,只需:
SET @@session.time_zone='+00:00'; -- UTC
或者:
SET time_zone = '+00:00';
为了使其永久化,您可以更改mysqld.conf文件(需要重新启动服务器(:
default_time_zone='+00:00'
DB Fiddle上的演示:
SELECT @@global.time_zone, @@session.time_zone;
@@global.time_zone|@@session.time_zone:------------------|:------------------SYSTEM|SYSTEM
SET @@session.time_zone='+00:00';
SELECT @@global.time_zone, @@session.time_zone;
@@global.time_zone|@@session.time_zone:------------------|:------------------SYSTEM |+000:00