我目前在使用时遇到了问题mariadb-10.0
。使用导入本地时间后mysql_tzinfo_to_sql
(如所述这里)并添加到我的error.log部分default_time_zone = UTC
告诉我以下内容。[mysqld]
/etc/mysql/mariadb.conf.d/50-server.cnf
161004 12:15:57 [ERROR] Fatal error: Illegal or unknown default time zone 'UTC'
161004 12:15:57 [Note] InnoDB: Using mutexes to ref count buffer pool pages
161004 12:15:57 [Note] InnoDB: The InnoDB memory heap is disabled
161004 12:15:57 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
161004 12:15:57 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
161004 12:15:57 [Note] InnoDB: Compressed tables use zlib 1.2.8
161004 12:15:57 [Note] InnoDB: Using Linux native AIO
161004 12:15:57 [Note] InnoDB: Using CPU crc32 instructions
161004 12:15:57 [Note] InnoDB: Initializing buffer pool, size = 2.5G
161004 12:15:57 [Note] InnoDB: Completed initialization of buffer pool
161004 12:15:58 [Note] InnoDB: Highest supported file format is Barracuda.
161004 12:15:58 [Note] InnoDB: 128 rollback segment(s) are active.
161004 12:15:58 [Note] InnoDB: Waiting for purge to start
161004 12:15:58 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.31-77.0 started; log sequence number 43378228606
161004 12:15:58 [Note] Plugin 'FEEDBACK' is disabled.
161004 12:15:58 [ERROR] Fatal error: Illegal or unknown default time zone 'UTC'
检查我的mysql_tzinfo_to_sql
以下内容将被导入:
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
SET @time_zone_id= LAST_INSERT_ID();
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('UTC', @time_zone_id);
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
(@time_zone_id, 0, 0, 0, 'UTC')
;
到目前为止,time_zone_name 表看起来正确:
MariaDB [(none)]> select * from mysql.time_zone_name where name like '%UTC%';
+---------------+--------------+
| Name | Time_zone_id |
+---------------+--------------+
| Etc/UTC | 418 |
| UTC | 597 |
| posix/Etc/UTC | 1020 |
| posix/UTC | 1199 |
| right/Etc/UTC | 1622 |
| right/UTC | 1801 |
+---------------+--------------+