問題発生
状態:-
閲覧数:1,943
投稿日:2018-10-15
更新日:2018-10-15
昨日まで表示されていたWebページでエラー発生
デバッグ表示した結果
Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] Connection refused
MySQLへログイン出来ない
いつの間にかMySQLへログイン出来なくなっている
$ mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
エラーログ確認
エラーログ確認
$ less /var/log/mysqld.log
2018-10-14T06:49:21.522899+09:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 11173ms. The settings might not be optimal. (flushed=134 and evicted=0, during the time.)
2018-10-14T06:51:29.257647+09:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-10-14T06:51:29.448835+09:00 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.
2018-10-14T06:51:29.570831+09:00 0 [Note] /usr/sbin/mysqld (mysqld 5.7.21) starting as process 28844 ...
2018-10-14T06:51:29.778503+09:00 0 [Note] InnoDB: PUNCH HOLE support available
2018-10-14T06:51:29.778597+09:00 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-10-14T06:51:29.778609+09:00 0 [Note] InnoDB: Uses event mutexes
2018-10-14T06:51:29.778641+09:00 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-10-14T06:51:29.778650+09:00 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-10-14T06:51:29.778662+09:00 0 [Note] InnoDB: Using Linux native AIO
2018-10-14T06:51:29.779597+09:00 0 [Note] InnoDB: Number of pools: 1
2018-10-14T06:51:29.779940+09:00 0 [Note] InnoDB: Using CPU crc32 instructions
2018-10-14T06:51:29.788826+09:00 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-10-14T06:51:29.823086+09:00 0 [Note] InnoDB: Completed initialization of buffer pool
2018-10-14T06:51:29.834727+09:00 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-10-14T06:51:29.906550+09:00 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-10-14T06:51:31.422589+09:00 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 3891279506
2018-10-14T06:51:31.422699+09:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 3891279959
2018-10-14T06:51:31.522988+09:00 0 [Note] InnoDB: Database was not shutdown normally!
2018-10-14T06:51:31.523036+09:00 0 [Note] InnoDB: Starting crash recovery.
2018-10-14T06:51:32.732037+09:00 0 [Note] InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 91 92 93 94 95 96 97 98 99
2018-10-14T06:51:33.328528+09:00 0 [Note] InnoDB: Apply batch completed
2018-10-14T06:52:12.919127+09:00 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-10-14T06:52:13.011842+09:00 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-10-10T17:57:30.977173+09:00 0 [Note] Event Scheduler: Loaded 0 events
2018-10-10T17:57:30.977640+09:00 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.21' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
2018-10-10T17:57:31.486220+09:00 0 [Note] InnoDB: Buffer pool(s) load completed at 181010 17:57:31
2018-10-12T03:02:21.094866+09:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 6958ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2018-10-12T05:01:23.673353+09:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4515ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2018-10-12T06:34:29.659837+09:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4820ms. The settings might not be optimal. (flushed=4 and evicted=0, during the time.)
2018-10-12T06:45:22.227098+09:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4631ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2018-10-12T11:36:26.509037+09:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 5165ms. The settings might not be optimal. (flushed=29 and evicted=0, during the time.)
2018-10-12T14:15:58.875740+09:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 5114ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2018-10-12T15:32:00.146300+09:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4225ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2018-10-12T22:20:39.556244+09:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 5591ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2018-10-13T06:47:21.273807+09:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4584ms. The settings might not be optimal. (flushed=13 and evicted=0, during the time.)
2018-10-13T10:21:51.835972+09:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4214ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2018-10-14T06:49:21.522899+09:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 11173ms. The settings might not be optimal. (flushed=134 and evicted=0, during the time.)
2018-10-14T06:51:29.257647+09:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-10-14T06:51:29.448835+09:00 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.
2018-10-14T06:51:29.570831+09:00 0 [Note] /usr/sbin/mysqld (mysqld 5.7.21) starting as process 28844 ...
2018-10-14T06:51:29.778503+09:00 0 [Note] InnoDB: PUNCH HOLE support available
2018-10-14T06:51:29.778597+09:00 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-10-14T06:51:29.778609+09:00 0 [Note] InnoDB: Uses event mutexes
2018-10-14T06:51:29.778641+09:00 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-10-14T06:51:29.778650+09:00 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-10-14T06:51:29.778662+09:00 0 [Note] InnoDB: Using Linux native AIO
2018-10-14T06:51:29.779597+09:00 0 [Note] InnoDB: Number of pools: 1
2018-10-14T06:51:29.779940+09:00 0 [Note] InnoDB: Using CPU crc32 instructions
2018-10-14T06:51:29.788826+09:00 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-10-14T06:51:29.823086+09:00 0 [Note] InnoDB: Completed initialization of buffer pool
2018-10-14T06:51:29.834727+09:00 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-10-14T06:51:29.906550+09:00 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-10-14T06:51:31.422589+09:00 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 3891279506
2018-10-14T06:51:31.422699+09:00 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 3891279959
2018-10-14T06:51:31.522988+09:00 0 [Note] InnoDB: Database was not shutdown normally!
2018-10-14T06:51:31.523036+09:00 0 [Note] InnoDB: Starting crash recovery.
2018-10-14T06:51:32.732037+09:00 0 [Note] InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 91 92 93 94 95 96 97 98 99
2018-10-14T06:51:33.328528+09:00 0 [Note] InnoDB: Apply batch completed
2018-10-14T06:52:12.919127+09:00 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-10-14T06:52:13.011842+09:00 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-10-14T06:52:13.012120+09:00 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-10-14T06:52:14.008354+09:00 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-10-14T06:52:14.119824+09:00 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-10-14T06:52:14.119890+09:00 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-10-14T06:52:14.121335+09:00 0 [Note] InnoDB: Waiting for purge to start
2018-10-14T06:52:14.171763+09:00 0 [Note] InnoDB: Waiting for purge to start
2018-10-14T06:52:14.221942+09:00 0 [Note] InnoDB: Waiting for purge to start
2018-10-14T06:52:14.272169+09:00 0 [Note] InnoDB: Waiting for purge to start
2018-10-14T06:52:14.322391+09:00 0 [Note] InnoDB: Waiting for purge to start
2018-10-14T06:52:15.175901+09:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 45341ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2018-10-14T06:52:15.209390+09:00 0 [Note] InnoDB: 5.7.21 started; log sequence number 3891279959
2018-10-14T06:52:15.411491+09:00 0 [Note] Plugin 'FEDERATED' is disabled.
2018-10-14T06:52:15.412187+09:00 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2018-10-14T06:52:15.911183+09:00 0 [ERROR] Can't open shared library '/usr/lib64/mysql/plugin/ha_mroonga.so' (errno: 2 /usr/lib64/mysql/plugin/ha_mroonga.so: cannot open shared object file: No such file or directory)
2018-10-14T06:52:15.911416+09:00 0 [Warning] Couldn't load plugin named 'Mroonga' with soname 'ha_mroonga.so'.
2018-10-14T06:52:15.913913+09:00 0 [Note] Plugin 'validate_password' is disabled.
2018-10-14T06:52:15.914451+09:00 0 [Note] Mecab: Trying createModel(--rcfile=/usr/lib64/mysql/mecab/etc/mecabrc)
2018-10-14T06:52:15.921024+09:00 0 [ERROR] Mecab: createModel() failed: param.cpp(69) [ifs] no such file or directory: /path/to/mysql/lib/mecab/lib/mecab/dic/ipadic_euc-jp/dicrc
2018-10-14T06:52:15.921055+09:00 0 [ERROR] Plugin 'mecab' init function returned error.
2018-10-14T06:52:16.132012+09:00 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2018-10-14T06:52:16.143965+09:00 0 [Warning] CA certificate ca.pem is self signed.
2018-10-14T06:52:16.229120+09:00 0 [Note] Server hostname (bind-address): '*'; port: 3306
2018-10-14T06:52:16.311487+09:00 0 [Note] IPv6 is available.
2018-10-14T06:52:16.311570+09:00 0 [Note] - '::' resolves to '::';
2018-10-14T06:52:16.311644+09:00 0 [Note] Server socket created on IP: '::'.
2018-10-14T06:52:17.528129+09:00 0 [ERROR] Can't open shared library 'ha_mroonga.so' (errno: 0 /usr/lib64/mysql/plugin/ha_mroonga.so: cannot open shared object file: No such file or directory)
2018-10-14T06:52:17.528199+09:00 0 [ERROR] Can't open shared library 'ha_mroonga.so' (errno: 0 /usr/lib64/mysql/plugin/ha_mroonga.so: cannot open shared object file: No such file or directory)
2018-10-14T06:52:17.528222+09:00 0 [ERROR] Can't open shared library 'ha_mroonga.so' (errno: 0 /usr/lib64/mysql/plugin/ha_mroonga.so: cannot open shared object file: No such file or directory)
2018-10-14T06:52:17.528233+09:00 0 [ERROR] Can't open shared library 'ha_mroonga.so' (errno: 0 /usr/lib64/mysql/plugin/ha_mroonga.so: cannot open shared object file: No such file or directory)
2018-10-14T06:52:17.528244+09:00 0 [ERROR] Can't open shared library 'ha_mroonga.so' (errno: 0 /usr/lib64/mysql/plugin/ha_mroonga.so: cannot open shared object file: No such file or directory)
2018-10-14T06:52:17.528255+09:00 0 [ERROR] Can't open shared library 'ha_mroonga.so' (errno: 0 /usr/lib64/mysql/plugin/ha_mroonga.so: cannot open shared object file: No such file or directory)
2018-10-14T06:52:17.528266+09:00 0 [ERROR] Can't open shared library 'ha_mroonga.so' (errno: 0 /usr/lib64/mysql/plugin/ha_mroonga.so: cannot open shared object file: No such file or directory)
2018-10-14T06:52:17.528278+09:00 0 [ERROR] Can't open shared library 'ha_mroonga.so' (errno: 0 /usr/lib64/mysql/plugin/ha_mroonga.so: cannot open shared object file: No such file or directory)
2018-10-14T06:52:17.528289+09:00 0 [ERROR] Can't open shared library 'ha_mroonga.so' (errno: 0 /usr/lib64/mysql/plugin/ha_mroonga.so: cannot open shared object file: No such file or directory)
2018-10-14T06:52:17.811656+09:00 0 [Note] InnoDB: Buffer pool(s) load completed at 181014 6:52:17
2018-10-14T06:52:18.612662+09:00 0 [Note] Event Scheduler: Loaded 0 events
2018-10-14T06:52:18.615046+09:00 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.21' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
2018-10-14T22:45:45.248834+09:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4220ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2018-10-15T07:30:26.802650+09:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4741ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
2018-10-15T07:50:23.328205+09:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4752ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
MySQL再起動
エラーログ見ても良く分からないので、MySQL再起動させてみる
$ sudo service mysqld restart
[sudo] password for ☆☆:
Redirecting to /bin/systemctl restart mysqld.service
リダイレクトされたので、次回からは下記で良いと思われ
$ systemctl restart mysqld.servic
再起動した結果
・エラー原因は不明だが、取りあえず、Webサイトは正常表示されるようになった