将 MySQL 默认时区设置为欧洲/柏林会导致 MySQL 崩溃

将 MySQL 默认时区设置为欧洲/柏林会导致 MySQL 崩溃

Ubuntu 18.04.6 LTS (GNU/Linux 4.15.0 x86_64)我正在运行带有和 的VPS MySQL 5.7.40

到目前为止,我总是采取以下步骤在新服务器上为 MySQL 设置正确的时区:

第一的:sudo apt-get install --reinstall tzdata

然后我选择EuropeBerlin位于:sudo dpkg-reconfigure tzdata

然后控制台打印:Current default time zone: 'Europe/Berlin'

然后我打开/etc/mysql/mysql.conf.d/mysqld.cnf改成default-time-zone

default-time-zone = "Europe/Berlin"

然后我使用以下命令重新启动 MySQL:sudo service mysql restart

现在新的时区Europe/Berlin已经正确设置。

但是今天我尝试这个方法却没有任何效果。MySQL 服务器甚至没有启动。

sudo service mysql restart给我:

Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.

为什么它不再起作用了?如何将 MySQL 的时区设置为Europe/Berlin

编辑:我是否必须完全删除default-time-zonemysqld.cnf才能使 MySQL 自动采用我设置的系统时间sudo dpkg-reconfigure tzdata

编辑: sudo systemctl status mysql.service显示:

● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: deactivating (stop-sigterm) (Result: exit-code) since Thu 2022-12-15 16:42:36 CET; 52s ago
  Process: 3294 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)
  Process: 3285 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 698 (code=exited, status=0/SUCCESS)
    Tasks: 12 (limit: 4915)
   CGroup: /system.slice/mysql.service
           └─3297 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid

Dec 15 16:43:27 user123.example.com systemd[1]: Starting MySQL Community Server...
Dec 15 16:43:28 user123.example.com mysqld[3294]: Initialization of mysqld failed: 0
Dec 15 16:43:28 user123.example.com systemd[1]: mysql.service: Control process exited, code=exited status=1

journalctl -xe显示:

-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit mysql.service has finished shutting down.
Dec 15 16:45:50 user123.example.com systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit mysql.service has begun starting up.
Dec 15 16:45:50 user123.example.com mysqld[5588]: Initialization of mysqld failed: 0
Dec 15 16:45:50 user123.example.com systemd[1]: mysql.service: Control process exited, code=exited status=1
Dec 15 16:45:52 user123.example.com systemd[1]: mysql.service: Failed with result 'exit-code'.
Dec 15 16:45:52 user123.example.com systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit mysql.service has failed.
-- 
-- The result is RESULT.
Dec 15 16:45:52 user123.example.com systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Dec 15 16:45:52 user123.example.com systemd[1]: mysql.service: Scheduled restart job, restart counter is at 61.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Automatic restarting of the unit mysql.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Dec 15 16:45:52 user123.example.com systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit mysql.service has finished shutting down.
Dec 15 16:45:52 user123.example.com systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit mysql.service has begun starting up.
Dec 15 16:45:53 user123.example.com mysqld[5628]: Initialization of mysqld failed: 0
Dec 15 16:45:53 user123.example.com systemd[1]: mysql.service: Control process exited, code=exited status=1
lines 2885-2927/2927 (END)

编辑:

这是我添加到后运行/var/log/mysql/error.log时显示的内容:sudo service mysql restartdefault-time-zone = "Europe/Berlin"/etc/mysql/mysql.conf.d/mysqld.cnf

2022-12-16T05:48:08.550155Z 0 [Note] Giving 1 client threads a chance to die gracefully
2022-12-16T05:48:08.550190Z 0 [Note] Shutting down slave threads
2022-12-16T05:48:10.550263Z 0 [Note] Forcefully disconnecting 1 remaining clients
2022-12-16T05:48:10.550289Z 0 [Note] Event Scheduler: Killing the scheduler thread, thread id 1
2022-12-16T05:48:10.550296Z 0 [Note] Event Scheduler: Waiting for the scheduler thread to reply
2022-12-16T05:48:10.550348Z 0 [Note] Event Scheduler: Stopped
2022-12-16T05:48:10.550356Z 0 [Note] Event Scheduler: Purging the queue. 4 events
2022-12-16T05:48:10.550394Z 0 [Note] Binlog end
2022-12-16T05:48:10.550745Z 0 [Note] Shutting down plugin 'auth_socket'
2022-12-16T05:48:10.550758Z 0 [Note] Shutting down plugin 'ngram'
2022-12-16T05:48:10.550764Z 0 [Note] Shutting down plugin 'partition'
2022-12-16T05:48:10.550770Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2022-12-16T05:48:10.550776Z 0 [Note] Shutting down plugin 'ARCHIVE'
2022-12-16T05:48:10.550782Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2022-12-16T05:48:10.550810Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2022-12-16T05:48:10.550816Z 0 [Note] Shutting down plugin 'MyISAM'
2022-12-16T05:48:10.550822Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2022-12-16T05:48:10.550826Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2022-12-16T05:48:10.550829Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2022-12-16T05:48:10.550832Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2022-12-16T05:48:10.550835Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2022-12-16T05:48:10.550838Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2022-12-16T05:48:10.550841Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2022-12-16T05:48:10.550843Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2022-12-16T05:48:10.550846Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2022-12-16T05:48:10.550849Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2022-12-16T05:48:10.550852Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2022-12-16T05:48:10.550855Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2022-12-16T05:48:10.550858Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2022-12-16T05:48:10.550861Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2022-12-16T05:48:10.550863Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2022-12-16T05:48:10.550866Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2022-12-16T05:48:10.550869Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2022-12-16T05:48:10.550872Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2022-12-16T05:48:10.550875Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2022-12-16T05:48:10.550878Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2022-12-16T05:48:10.550881Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2022-12-16T05:48:10.550883Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2022-12-16T05:48:10.550886Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2022-12-16T05:48:10.550889Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2022-12-16T05:48:10.550892Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2022-12-16T05:48:10.550895Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2022-12-16T05:48:10.550898Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2022-12-16T05:48:10.550901Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2022-12-16T05:48:10.550904Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2022-12-16T05:48:10.550907Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2022-12-16T05:48:10.550910Z 0 [Note] Shutting down plugin 'InnoDB'
2022-12-16T05:48:10.551105Z 0 [Note] InnoDB: FTS optimize thread exiting.
2022-12-16T05:48:10.551145Z 0 [Note] InnoDB: Starting shutdown...
2022-12-16T05:48:10.651252Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2022-12-16T05:48:10.651428Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 221216  6:48:10
2022-12-16T05:48:12.259412Z 0 [Note] InnoDB: Shutdown completed; log sequence number 1392488917
2022-12-16T05:48:12.261602Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2022-12-16T05:48:12.261629Z 0 [Note] Shutting down plugin 'MEMORY'
2022-12-16T05:48:12.261633Z 0 [Note] Shutting down plugin 'CSV'
2022-12-16T05:48:12.261638Z 0 [Note] Shutting down plugin 'sha256_password'
2022-12-16T05:48:12.261640Z 0 [Note] Shutting down plugin 'mysql_native_password'
2022-12-16T05:48:12.261773Z 0 [Note] Shutting down plugin 'binlog'
2022-12-16T05:48:12.262193Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

2022-12-16T05:48:12.858254Z 0 [Warning] option 'binlog_cache_size': unsigned value 0 adjusted to 4096
2022-12-16T05:48:12.858399Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2022-12-16T05:48:12.858412Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2022-12-16T05:48:12.859900Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.40-0ubuntu0.18.04.1) starting as process 24903 ...
2022-12-16T05:48:12.864068Z 0 [Note] InnoDB: PUNCH HOLE support available
2022-12-16T05:48:12.864101Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2022-12-16T05:48:12.864106Z 0 [Note] InnoDB: Uses event mutexes
2022-12-16T05:48:12.864109Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2022-12-16T05:48:12.864113Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
2022-12-16T05:48:12.864120Z 0 [Note] InnoDB: Using Linux native AIO
2022-12-16T05:48:12.864994Z 0 [Note] InnoDB: Number of pools: 1
2022-12-16T05:48:12.868218Z 0 [Note] InnoDB: Using CPU crc32 instructions
2022-12-16T05:48:12.869546Z 0 [Note] InnoDB: Initializing buffer pool, total size = 8M, instances = 1, chunk size = 8M
2022-12-16T05:48:12.871238Z 0 [Note] InnoDB: Completed initialization of buffer pool
2022-12-16T05:48:12.872592Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2022-12-16T05:48:12.927953Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2022-12-16T05:48:12.971117Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-12-16T05:48:12.971174Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-12-16T05:48:13.343700Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-12-16T05:48:13.344553Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2022-12-16T05:48:13.344568Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2022-12-16T05:48:13.344895Z 0 [Note] InnoDB: Waiting for purge to start
2022-12-16T05:48:13.395214Z 0 [Note] InnoDB: 5.7.40 started; log sequence number 1392488917
2022-12-16T05:48:13.395598Z 0 [Note] Plugin 'FEDERATED' is disabled.
2022-12-16T05:48:13.395745Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-12-16T05:48:13.405365Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2022-12-16T05:48:13.405387Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2022-12-16T05:48:13.405395Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2022-12-16T05:48:13.405403Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2022-12-16T05:48:13.406162Z 0 [Note] InnoDB: Buffer pool(s) load completed at 221216  6:48:13
2022-12-16T05:48:13.406497Z 0 [Warning] CA certificate ca.pem is self signed.
2022-12-16T05:48:13.406530Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2022-12-16T05:48:13.406919Z 0 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
2022-12-16T05:48:13.406934Z 0 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
2022-12-16T05:48:13.407087Z 0 [Note] Server socket created on IP: '0.0.0.0'.
2022-12-16T05:48:13.414045Z 0 [ERROR] Fatal error: Illegal or unknown default time zone 'Europe/Berlin'
2022-12-16T05:48:13.414088Z 0 [ERROR] Fatal error: Failed to initialize ACL/grant/time zones structures or failed to remove temporary table files.
2022-12-16T05:48:13.414128Z 0 [ERROR] Aborting

2022-12-16T05:48:13.414160Z 0 [Note] Binlog end
2022-12-16T05:48:13.414347Z 0 [Note] Shutting down plugin 'auth_socket'
2022-12-16T05:48:13.414358Z 0 [Note] Shutting down plugin 'ngram'
2022-12-16T05:48:13.414364Z 0 [Note] Shutting down plugin 'partition'
2022-12-16T05:48:13.414369Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2022-12-16T05:48:13.414374Z 0 [Note] Shutting down plugin 'ARCHIVE'
2022-12-16T05:48:13.414379Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2022-12-16T05:48:13.414471Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2022-12-16T05:48:13.414478Z 0 [Note] Shutting down plugin 'MyISAM'
2022-12-16T05:48:13.414485Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2022-12-16T05:48:13.414490Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2022-12-16T05:48:13.414495Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2022-12-16T05:48:13.414499Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2022-12-16T05:48:13.414504Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2022-12-16T05:48:13.414509Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2022-12-16T05:48:13.414513Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2022-12-16T05:48:13.414518Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2022-12-16T05:48:13.414523Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2022-12-16T05:48:13.414527Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2022-12-16T05:48:13.414531Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2022-12-16T05:48:13.414534Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2022-12-16T05:48:13.414538Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2022-12-16T05:48:13.414542Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2022-12-16T05:48:13.414546Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2022-12-16T05:48:13.414550Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2022-12-16T05:48:13.414555Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2022-12-16T05:48:13.414558Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2022-12-16T05:48:13.414563Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2022-12-16T05:48:13.414566Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2022-12-16T05:48:13.414570Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2022-12-16T05:48:13.414574Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2022-12-16T05:48:13.414578Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2022-12-16T05:48:13.414582Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2022-12-16T05:48:13.414586Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2022-12-16T05:48:13.414591Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2022-12-16T05:48:13.414595Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2022-12-16T05:48:13.414599Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2022-12-16T05:48:13.414604Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2022-12-16T05:48:13.414609Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2022-12-16T05:48:13.414613Z 0 [Note] Shutting down plugin 'InnoDB'
2022-12-16T05:48:13.415886Z 0 [Note] InnoDB: FTS optimize thread exiting.
2022-12-16T05:48:13.416009Z 0 [Note] InnoDB: Starting shutdown...
2022-12-16T05:48:13.516295Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2022-12-16T05:48:13.516442Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 221216  6:48:13
2022-12-16T05:48:15.029165Z 0 [Note] InnoDB: Shutdown completed; log sequence number 1392488936
2022-12-16T05:48:15.031232Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2022-12-16T05:48:15.031245Z 0 [Note] Shutting down plugin 'MEMORY'
2022-12-16T05:48:15.031250Z 0 [Note] Shutting down plugin 'CSV'
2022-12-16T05:48:15.031254Z 0 [Note] Shutting down plugin 'sha256_password'
2022-12-16T05:48:15.031257Z 0 [Note] Shutting down plugin 'mysql_native_password'
2022-12-16T05:48:15.031417Z 0 [Note] Shutting down plugin 'binlog'
2022-12-16T05:48:15.031776Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

2022-12-16T05:48:15.663103Z 0 [Warning] option 'binlog_cache_size': unsigned value 0 adjusted to 4096
2022-12-16T05:48:15.663243Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2022-12-16T05:48:15.663263Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2022-12-16T05:48:15.664921Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.40-0ubuntu0.18.04.1) starting as process 24942 ...
2022-12-16T05:48:15.669278Z 0 [Note] InnoDB: PUNCH HOLE support available
2022-12-16T05:48:15.669318Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2022-12-16T05:48:15.669326Z 0 [Note] InnoDB: Uses event mutexes
2022-12-16T05:48:15.669333Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2022-12-16T05:48:15.669340Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
2022-12-16T05:48:15.669351Z 0 [Note] InnoDB: Using Linux native AIO
2022-12-16T05:48:15.669721Z 0 [Note] InnoDB: Number of pools: 1
2022-12-16T05:48:15.670082Z 0 [Note] InnoDB: Using CPU crc32 instructions
2022-12-16T05:48:15.671500Z 0 [Note] InnoDB: Initializing buffer pool, total size = 8M, instances = 1, chunk size = 8M
2022-12-16T05:48:15.672083Z 0 [Note] InnoDB: Completed initialization of buffer pool
2022-12-16T05:48:15.672550Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2022-12-16T05:48:15.685096Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2022-12-16T05:48:15.699358Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-12-16T05:48:15.749507Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-12-16T05:48:15.999356Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-12-16T05:48:15.999881Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2022-12-16T05:48:15.999893Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2022-12-16T05:48:16.000342Z 0 [Note] InnoDB: Waiting for purge to start
2022-12-16T05:48:16.050473Z 0 [Note] InnoDB: 5.7.40 started; log sequence number 1392488936
2022-12-16T05:48:16.050633Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-12-16T05:48:16.050751Z 0 [Note] Plugin 'FEDERATED' is disabled.
2022-12-16T05:48:16.052749Z 0 [Note] InnoDB: Buffer pool(s) load completed at 221216  6:48:16
2022-12-16T05:48:16.056473Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2022-12-16T05:48:16.056492Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2022-12-16T05:48:16.056497Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2022-12-16T05:48:16.056500Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2022-12-16T05:48:16.056934Z 0 [Warning] CA certificate ca.pem is self signed.
2022-12-16T05:48:16.056959Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2022-12-16T05:48:16.057014Z 0 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
2022-12-16T05:48:16.057023Z 0 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
2022-12-16T05:48:16.057142Z 0 [Note] Server socket created on IP: '0.0.0.0'.
2022-12-16T05:48:16.058316Z 0 [ERROR] Fatal error: Illegal or unknown default time zone 'Europe/Berlin'
2022-12-16T05:48:16.058341Z 0 [ERROR] Fatal error: Failed to initialize ACL/grant/time zones structures or failed to remove temporary table files.
2022-12-16T05:48:16.058369Z 0 [ERROR] Aborting

2022-12-16T05:48:16.058463Z 0 [Note] Binlog end
2022-12-16T05:48:16.058585Z 0 [Note] Shutting down plugin 'auth_socket'
2022-12-16T05:48:16.058592Z 0 [Note] Shutting down plugin 'ngram'
2022-12-16T05:48:16.058596Z 0 [Note] Shutting down plugin 'partition'
2022-12-16T05:48:16.058599Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2022-12-16T05:48:16.058603Z 0 [Note] Shutting down plugin 'ARCHIVE'
2022-12-16T05:48:16.058606Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2022-12-16T05:48:16.058635Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2022-12-16T05:48:16.058639Z 0 [Note] Shutting down plugin 'MyISAM'
2022-12-16T05:48:16.058643Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2022-12-16T05:48:16.058646Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2022-12-16T05:48:16.058649Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2022-12-16T05:48:16.058652Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2022-12-16T05:48:16.058655Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2022-12-16T05:48:16.058658Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2022-12-16T05:48:16.058661Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2022-12-16T05:48:16.058664Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2022-12-16T05:48:16.058667Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2022-12-16T05:48:16.058670Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2022-12-16T05:48:16.058673Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2022-12-16T05:48:16.058676Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2022-12-16T05:48:16.058679Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2022-12-16T05:48:16.058682Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2022-12-16T05:48:16.058685Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2022-12-16T05:48:16.058688Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2022-12-16T05:48:16.058691Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2022-12-16T05:48:16.058694Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2022-12-16T05:48:16.058697Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2022-12-16T05:48:16.058700Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2022-12-16T05:48:16.058703Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2022-12-16T05:48:16.058705Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2022-12-16T05:48:16.058708Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2022-12-16T05:48:16.058711Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2022-12-16T05:48:16.058714Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2022-12-16T05:48:16.058717Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2022-12-16T05:48:16.058720Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2022-12-16T05:48:16.058723Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2022-12-16T05:48:16.058726Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2022-12-16T05:48:16.058729Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2022-12-16T05:48:16.058732Z 0 [Note] Shutting down plugin 'InnoDB'
2022-12-16T05:48:16.059098Z 0 [Note] InnoDB: FTS optimize thread exiting.
2022-12-16T05:48:16.059291Z 0 [Note] InnoDB: Starting shutdown...
2022-12-16T05:48:16.159378Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2022-12-16T05:48:16.159553Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 221216  6:48:16

答案1

我遇到了同样的问题。似乎在我所有的 MySQL 5.7 安装中,时区表都是开箱即用的,而在 MySQL 8.0 中,或者至少在我的 Ubuntu 22 安装中,时区表是空的。

您必须注释掉那个默认时区,以便 MySQL 重新启动并启动它。

尝试运行:

select * from time_zone_name;

可能你会看到它是一张空表并且 MySQL 似乎从这里读取。

要填充时区表,请运行:

mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

另请参阅/致谢: https://stackoverflow.com/questions/49518683/the-server-time-zone-value-cest-is-unrecognized

就我而言,我遇到了 STDERR 错误,并且管道无法工作,而是以下方法有效:

mysql_tzinfo_to_sql /usr/share/zoneinfo 2>/dev/null > tzdata.sql

tzdata.sql文件包含137'464行,我将其加载:

cat tzdata.sql | mysql -u root mysql -p

之后我可以设置(对我来说)

default_time_zone=Europe/Zurich

或者:

default_time_zone=Europe/Berlin

(实际上它实现了相同的功能)

相关内容