Mysql

mysqld 每 1 小時關閉一次

  • May 8, 2022

請幫我解決問題。每小時啟動一次mysql關閉。伺服器上的站點自然無法連接到數據庫,並且我在站點的日誌中收到一堆錯誤。

配置:Debian7 - MySql5.5

日誌:

220507  4:57:51 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
220507  4:57:51 [Note] Plugin 'FEDERATED' is disabled.
220507  4:57:51 InnoDB: The InnoDB memory heap is disabled
220507  4:57:51 InnoDB: Mutexes and rw_locks use GCC atomic builtins
220507  4:57:51 InnoDB: Compressed tables use zlib 1.2.7
220507  4:57:51 InnoDB: Using Linux native AIO
220507  4:57:51 InnoDB: Initializing buffer pool, size = 128.0M
220507  4:57:51 InnoDB: Completed initialization of buffer pool
220507  4:57:51 InnoDB: highest supported file format is Barracuda.
220507  4:57:51  InnoDB: Waiting for the background threads to start
220507  4:57:52 InnoDB: 5.5.59 started; log sequence number 39623337
220507  4:57:52 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
220507  4:57:52 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
220507  4:57:52 [Note] Server socket created on IP: '0.0.0.0'.
220507  4:57:52 [Note] Event Scheduler: Loaded 0 events
220507  4:57:52 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.59-0+deb7u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)
220507  4:58:54 [Note] /usr/sbin/mysqld: Normal shutdown

220507  4:58:54 [Note] Event Scheduler: Purging the queue. 0 events
220507  4:58:54  InnoDB: Starting shutdown...
220507  4:58:55  InnoDB: Shutdown completed; log sequence number 39623337
220507  4:58:55 [Note] /usr/sbin/mysqld: Shutdown complete

220507  4:58:56 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
220507  4:58:56 [Note] Plugin 'FEDERATED' is disabled.
220507  4:58:56 InnoDB: The InnoDB memory heap is disabled
220507  4:58:56 InnoDB: Mutexes and rw_locks use GCC atomic builtins
220507  4:58:56 InnoDB: Compressed tables use zlib 1.2.7
220507  4:58:56 InnoDB: Using Linux native AIO
220507  4:58:56 InnoDB: Initializing buffer pool, size = 128.0M
220507  4:58:56 InnoDB: Completed initialization of buffer pool
220507  4:58:56 InnoDB: highest supported file format is Barracuda.
220507  4:58:56  InnoDB: Waiting for the background threads to start
220507  4:58:57 InnoDB: 5.5.59 started; log sequence number 39623337
220507  4:58:57 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
220507  4:58:57 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
220507  4:58:57 [Note] Server socket created on IP: '0.0.0.0'.
220507  4:58:57 [Note] Event Scheduler: Loaded 0 events
220507  4:58:57 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.59-0+deb7u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)
220507  6:56:57 [Note] /usr/sbin/mysqld: Normal shutdown

220507  6:56:57 [Note] Event Scheduler: Purging the queue. 0 events
220507  6:56:59 [Warning] /usr/sbin/mysqld: Forcing close of thread 5486  user: 'root'

220507  6:56:59  InnoDB: Starting shutdown...
220507  6:57:01  InnoDB: Shutdown completed; log sequence number 39623337
220507  6:57:01 [Note] /usr/sbin/mysqld: Shutdown complete

220507  6:57:24 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
220507  6:57:24 [Note] Plugin 'FEDERATED' is disabled.
220507  6:57:24 InnoDB: The InnoDB memory heap is disabled
220507  6:57:24 InnoDB: Mutexes and rw_locks use GCC atomic builtins
220507  6:57:24 InnoDB: Compressed tables use zlib 1.2.7
220507  6:57:24 InnoDB: Using Linux native AIO
220507  6:57:24 InnoDB: Initializing buffer pool, size = 128.0M
220507  6:57:24 InnoDB: Completed initialization of buffer pool
220507  6:57:24 InnoDB: highest supported file format is Barracuda.
220507  6:57:24  InnoDB: Waiting for the background threads to start
220507  6:57:25 InnoDB: 5.5.59 started; log sequence number 39623337
220507  6:57:25 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
220507  6:57:25 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
220507  6:57:25 [Note] Server socket created on IP: '0.0.0.0'.
220507  6:57:25 [Note] Event Scheduler: Loaded 0 events
220507  6:57:25 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.59-0+deb7u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)
220507  9:48:12 [Note] /usr/sbin/mysqld: Normal shutdown

220507  9:48:12 [Note] Event Scheduler: Purging the queue. 0 events
220507  9:48:14 [Warning] /usr/sbin/mysqld: Forcing close of thread 8  user: 'root'

220507  9:48:14  InnoDB: Starting shutdown...
220507  9:48:15  InnoDB: Shutdown completed; log sequence number 39623337
220507  9:48:15 [Note] /usr/sbin/mysqld: Shutdown complete

220507  9:48:16 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
220507  9:48:16 [Note] Plugin 'FEDERATED' is disabled.
220507  9:48:16 InnoDB: The InnoDB memory heap is disabled
220507  9:48:16 InnoDB: Mutexes and rw_locks use GCC atomic builtins
220507  9:48:16 InnoDB: Compressed tables use zlib 1.2.7
220507  9:48:16 InnoDB: Using Linux native AIO
220507  9:48:16 InnoDB: Initializing buffer pool, size = 128.0M
220507  9:48:16 InnoDB: Completed initialization of buffer pool
220507  9:48:16 InnoDB: highest supported file format is Barracuda.
220507  9:48:16  InnoDB: Waiting for the background threads to start
220507  9:48:17 InnoDB: 5.5.59 started; log sequence number 39623337
220507  9:48:17 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
220507  9:48:17 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
220507  9:48:17 [Note] Server socket created on IP: '0.0.0.0'.
220507  9:48:17 [Note] Event Scheduler: Loaded 0 events
220507  9:48:17 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.59-0+deb7u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)
220507 10:24:19 [Note] /usr/sbin/mysqld: Normal shutdown

220507 10:24:19 [Note] Event Scheduler: Purging the queue. 0 events
220507 10:24:21 [Warning] /usr/sbin/mysqld: Forcing close of thread 13264  user: 'root'

220507 10:24:21  InnoDB: Starting shutdown...
220507 10:24:22  InnoDB: Shutdown completed; log sequence number 39627444
220507 10:24:22 [Note] /usr/sbin/mysqld: Shutdown complete

所以它無休止地重複。看門狗跟踪它,把它撿起來,然後它又掉了..

請幫忙….

添加了相同的

220508 10:41:53 [Note] Event Scheduler: Purging the queue. 0 events
220508 10:41:53  InnoDB: Starting shutdown...
220508 10:41:54  InnoDB: Shutdown completed; log sequence number 39659155
220508 10:41:54 [Note] /usr/sbin/mysqld: Shutdown complete

220508 10:42:20 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
220508 10:42:20 [Note] Plugin 'FEDERATED' is disabled.
220508 10:42:20 InnoDB: The InnoDB memory heap is disabled
220508 10:42:20 InnoDB: Mutexes and rw_locks use GCC atomic builtins
220508 10:42:20 InnoDB: Compressed tables use zlib 1.2.7
220508 10:42:20 InnoDB: Using Linux native AIO
220508 10:42:20 InnoDB: Initializing buffer pool, size = 128.0M
220508 10:42:20 InnoDB: Completed initialization of buffer pool
220508 10:42:20 InnoDB: highest supported file format is Barracuda.
220508 10:42:20  InnoDB: Waiting for the background threads to start
220508 10:42:21 InnoDB: 5.5.59 started; log sequence number 39659155
220508 10:42:21 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
220508 10:42:21 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
220508 10:42:21 [Note] Server socket created on IP: '0.0.0.0'.
220508 10:42:21 [Warning] 'user' entry 'root@vmtest2.thehost.com.ua' ignored in --skip-name-resolve mode.
220508 10:42:21 [Warning] 'proxies_priv' entry '@ root@vmtest2.thehost.com.ua' ignored in --skip-name-resolve mode.
220508 10:42:21 [Note] Event Scheduler: Loaded 0 events
220508 10:42:21 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.59-0+deb7u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)
220508 11:41:36 [Note] /usr/sbin/mysqld: Normal shutdown

220508 11:41:36 [Note] Event Scheduler: Purging the queue. 0 events
220508 11:41:38 [Warning] /usr/sbin/mysqld: Forcing close of thread 41  user: 'root'

220508 11:41:38  InnoDB: Starting shutdown...
220508 11:41:40  InnoDB: Shutdown completed; log sequence number 39659155
220508 11:41:40 [Note] /usr/sbin/mysqld: Shutdown complete

220508 11:41:41 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
220508 11:41:41 [Note] Plugin 'FEDERATED' is disabled.
220508 11:41:41 InnoDB: The InnoDB memory heap is disabled
220508 11:41:41 InnoDB: Mutexes and rw_locks use GCC atomic builtins
220508 11:41:41 InnoDB: Compressed tables use zlib 1.2.7
220508 11:41:41 InnoDB: Using Linux native AIO
220508 11:41:41 InnoDB: Initializing buffer pool, size = 128.0M
220508 11:41:41 InnoDB: Completed initialization of buffer pool
220508 11:41:41 InnoDB: highest supported file format is Barracuda.
220508 11:41:41  InnoDB: Waiting for the background threads to start
220508 11:41:42 InnoDB: 5.5.59 started; log sequence number 39659155
220508 11:41:42 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
220508 11:41:42 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
220508 11:41:42 [Note] Server socket created on IP: '0.0.0.0'.
220508 11:41:42 [Warning] 'user' entry 'root@vmtest2.thehost.com.ua' ignored in --skip-name-resolve mode.
220508 11:41:42 [Warning] 'proxies_priv' entry '@ root@vmtest2.thehost.com.ua' ignored in --skip-name-resolve mode.
220508 11:41:42 [Note] Event Scheduler: Loaded 0 events
220508 11:41:42 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.59-0+deb7u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)

vi 你的 my.cnf 文件;

添加變數跳過名稱解析;

然後重啟mysqld服務

引用自:https://dba.stackexchange.com/questions/311850