MySQL 崩潰 – 無法啟動

MySQL Crash

前幾天 VPS 主機無故的 MySQL 崩潰,無法再啟動了,紀錄一下錯誤訊息,以後再解了。

資料庫崩潰對我來說,是最頭痛難解的事情,網站被攻擊或者是外掛造成 PHP 錯誤,這是最常見的問題。

-- Subject: Unit mariadb.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mariadb.service has begun starting up.
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] /usr/sbin/mysqld (mysqld 10.1.24-MariaDB-1~xenial) starting as process 3135 ...
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] InnoDB: Using mutexes to ref count buffer pool pages
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] InnoDB: The InnoDB memory heap is disabled
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] InnoDB: Compressed tables use zlib 1.2.8
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] InnoDB: Using Linux native AIO
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] InnoDB: Using SSE crc32 instructions
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] InnoDB: Initializing buffer pool, size = 256.0M
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] InnoDB: Completed initialization of buffer pool
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] InnoDB: Highest supported file format is Barracuda.
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] InnoDB: The log sequence numbers 1600709 and 1600709 in ibdata files do not match the log sequence number 1600739 in the ib_logfiles!
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] InnoDB: Restoring possible half-written data pages from the doublewrite buffer...
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] InnoDB: 128 rollback segment(s) are active. 
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] InnoDB: Waiting for purge to start
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.36-82.0 started; log sequence number 1600739
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] Plugin 'FEEDBACK' is disabled.
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] Recovering after a crash using /var/log/mysql/mariadb-bin
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] Starting crash recovery...
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] Crash recovery finished.
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957699328 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos' doesn't exist
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367043200768 [Note] InnoDB: Dumping buffer pool(s) not yet started
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [Note] Server socket created on IP: '127.0.0.1'.
Jun 12 00:47:01 rootup375 mysqld[3135]: 2017-06-12  0:47:01 140367957895424 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
Jun 12 00:47:01 rootup375 systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Jun 12 00:47:01 rootup375 systemd[1]: Failed to start MariaDB database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mariadb.service has failed.
-- 
-- The result is failed.
Jun 12 00:47:01 rootup375 systemd[1]: mariadb.service: Unit entered failed state.
Jun 12 00:47:01 rootup375 systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jun 12 00:48:20 rootup375 google-accounts[1984]: INFO Removing user rupm66.
Jun 12 00:49:10 rootup375 /usr/lib/snapd/snapd[1393]: snapmgr.go:496: DEBUG: Next refresh scheduled for 2017-06-12 09:28:09.886408082 +0800 CST.

網路上的文章很多,記錄一篇問題很相識的文章:

Featured Photo 攝影師:nanoom,連結:Pixabay

Follow me

yungke

視咖啡如命的癮君子,沒有厲害的技術,只會小打小鬧的電腦工程師。WooWP Hosting 與 Kinsta 合作,推出最優惠、穩定的 GCP 主機方案,了解更多>>
yungke
Follow me
Advertisement

Follow Me

查看本文
喜愛 Like 點擊數!!
Back to top