LoginSignup
3

More than 1 year has passed since last update.

posted at

updated at

MySQLが動かなくなった

MySQLが起動不可に

いつものようにxamppからApacheとMySQLを起動すると、以下のようなエラーメッセージが羅列し、MySQLが起動出来なくなってしまいました。

 23:50:30  [mysql]     This may be due to a blocked port, missing dependencies, 
 23:50:30  [mysql]     improper privileges, a crash, or a shutdown by another method.
 23:50:30  [mysql]     Press the Logs button to view error logs and check
 23:50:30  [mysql]     the Windows Event Viewer for more clues
 23:50:30  [mysql]     If you need more help, copy and post this
 23:50:30  [mysql]     entire log window on the forums

Apacheは普通に起動出来たのに、何故かSQLは起動せず・・・。

原因は何か・・・?

MySQLのエラーログを確認してみると、以下のようなログが出力。

2019-09-30 23:50:28 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2019-09-30 23:50:28 0 [Note] InnoDB: Uses event mutexes
2019-09-30 23:50:28 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-09-30 23:50:28 0 [Note] InnoDB: Number of pools: 1
2019-09-30 23:50:28 0 [Note] InnoDB: Using SSE2 crc32 instructions
2019-09-30 23:50:28 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2019-09-30 23:50:28 0 [Note] InnoDB: Completed initialization of buffer pool
2019-09-30 23:50:28 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=1354642
2019-09-30 23:50:29 0 [Note] InnoDB: Starting final batch to recover 13 pages from redo log.
2019-09-30 23:50:29 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2019-09-30 23:50:29 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2019-09-30 23:50:29 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-09-30 23:50:29 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2019-09-30 23:50:29 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2019-09-30 23:50:29 0 [Note] InnoDB: Waiting for purge to start
2019-09-30 23:50:29 0 [Note] InnoDB: 10.3.16 started; log sequence number 1603984; transaction id 9
2019-09-30 23:50:29 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2019-09-30 23:50:29 0 [Note] InnoDB: Buffer pool(s) load completed at 190930 23:50:29
2019-09-30 23:50:29 0 [Note] Plugin 'FEEDBACK' is disabled.
2019-09-30 23:50:29 0 [Note] Server socket created on IP: '::'.

こいつらをググってみると、「ファイアウォールが許可されていない」「ポートが被っている」と出てきたのでファイアウォールとポートを確認したり設定を変えてみましたが、改善されず・・・。

テーブルがぶっ壊れていた。

どうにも独りでは解決出来ないので質問を投げてみると、「mysql.user」というテーブルが壊れている可能性があるとのご指摘をいただいた。
実際にSQLに繋がれなくなってしまったので確認は出来ませんでしたが、状況からこの可能性が非常に高いと感じました。

で、解決したかというと・・・

解決方法ですが、SQLを初期化するか再インストールしか無いとのこと。
結局再インストールすることにしました。

まとめ

結局根本的な解決には至りませんでしたが、こういったことは起きるものだと学んだ為、こちらに備忘録として書き留めることにしました。
思い当たる原因ですが、
⓵MySQLを切らず、又は切った直後にシャットダウンをしてしまった。
②Windows updateによるもの
の二つしか思い当たりませんでした。
特に①に関しては今後気を付けようと思います。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
3