サービス mysqld 5.6 は CentOS 6.9 で起動および停止し続けます。

サービス mysqld 5.6 は CentOS 6.9 で起動および停止し続けます。

私のVPSでは、mysqldの起動後に自動的に停止して再起動します。

試してみましたが、うまくいきましたsudo service mysqld stop。手動で正常に起動しました。ところで、突然止まってから始めて、ずっと始まって止まった。

毎回異なるPIDを取得します。

この問題をどのように解決できますか?

mysqldを手動で起動しましたが、次のエラーが発生しました。

2018-12-30 16:51:00 4535 [Note] Plugin 'FEDERATED' is disabled.
2018-12-30 16:51:00 4535 [Warning] option 'innodb-buffer-pool-size': signed value 65536 adjusted to 5242880
2018-12-30 16:51:00 4535 [Note] InnoDB: Using atomics to ref count buffer pool pages
2018-12-30 16:51:00 4535 [Note] InnoDB: The InnoDB memory heap is disabled
2018-12-30 16:51:00 4535 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-12-30 16:51:00 4535 [Note] InnoDB: Memory barrier is not used
2018-12-30 16:51:00 4535 [Note] InnoDB: Compressed tables use zlib 1.2.11
2018-12-30 16:51:00 4535 [Note] InnoDB: Using Linux native AIO
2018-12-30 16:51:00 4535 [Note] InnoDB: Using CPU crc32 instructions
2018-12-30 16:51:00 4535 [Note] InnoDB: Initializing buffer pool, size = 5.0M
2018-12-30 16:51:00 4535 [Note] InnoDB: Completed initialization of buffer pool
2018-12-30 16:51:00 4535 [Note] InnoDB: Highest supported file format is Barracuda.
2018-12-30 16:51:00 4535 [Note] InnoDB: 128 rollback segment(s) are active.
2018-12-30 16:51:00 4535 [Note] InnoDB: 5.6.42 started; log sequence number 4940394469
2018-12-30 16:51:00 4535 [Note] InnoDB: !!! innodb_force_recovery is set to 3 !!!
2018-12-30 16:51:00 4535 [Note] Server hostname (bind-address): '*'; port: 3306
2018-12-30 16:51:00 4535 [Note] IPv6 is available.
2018-12-30 16:51:00 4535 [Note]   - '::' resolves to '::';
2018-12-30 16:51:00 4535 [Note] Server socket created on IP: '::'.
2018-12-30 16:51:00 4535 [Warning] 'user' entry '[email protected]' ignored in --skip-name-resolve mode.
2018-12-30 16:51:00 4535 [Warning] 'user' entry '@v4452.vir.kagoya.net' ignored in --skip-name-resolve mode.
2018-12-30 16:51:00 4535 [Warning] 'proxies_priv' entry '@ [email protected]' ignored in --skip-name-resolve mode.
2018-12-30 16:51:00 4535 [Note] Event Scheduler: Loaded 0 events
2018-12-30 16:51:00 4535 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.42'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)
2018-12-30 16:51:15 4535 [ERROR] /usr/sbin/mysqld: Table './mylife/wp_options' is marked as crashed and should be repaired
2018-12-30 16:51:15 4535 [ERROR] /usr/sbin/mysqld: Table './mylife/wp_options' is marked as crashed and should be repaired
2018-12-30 16:51:15 4535 [ERROR] /usr/sbin/mysqld: Table './mylife/wp_options' is marked as crashed and should be repaired
2018-12-30 16:53:56 4535 [ERROR] /usr/sbin/mysqld: Table './mylife/wp_options' is marked as crashed and should be repaired
2018-12-30 16:53:56 4535 [ERROR] /usr/sbin/mysqld: Table './mylife/wp_options' is marked as crashed and should be repaired
2018-12-30 16:53:56 4535 [ERROR] /usr/sbin/mysqld: Table './mylife/wp_options' is marked as crashed and should be repaired
2018-12-30 16:54:16 4535 [ERROR] /usr/sbin/mysqld: Table './mylife/wp_options' is marked as crashed and should be repaired
2018-12-30 16:54:16 4535 [ERROR] /usr/sbin/mysqld: Table './mylife/wp_options' is marked as crashed and should be repaired
2018-12-30 16:54:16 4535 [ERROR] /usr/sbin/mysqld: Table './mylife/wp_options' is marked as crashed and should be repaired
2018-12-30 16:54:32 4535 [ERROR] /usr/sbin/mysqld: Table './mylife/wp_options' is marked as crashed and should be repaired
2018-12-30 16:54:32 4535 [ERROR] /usr/sbin/mysqld: Table './mylife/wp_options' is marked as crashed and should be repaired
2018-12-30 16:54:32 4535 [ERROR] /usr/sbin/mysqld: Table './mylife/wp_options' is marked as crashed and should be repaired
2018-12-30 16:54:33 4535 [ERROR] /usr/sbin/mysqld: Table './mylife/wp_options' is marked as crashed and should be repaired
2018-12-30 16:54:33 4535 [ERROR] /usr/sbin/mysqld: Table './mylife/wp_options' is marked as crashed and should be repaired
2018-12-30 16:54:33 4535 [ERROR] /usr/sbin/mysqld: Table './mylife/wp_options' is marked as crashed and should be repaired
2018-12-30 16:56:18 4535 [ERROR] /usr/sbin/mysqld: Table './mylife/wp_options' is marked as crashed and should be repaired
2018-12-30 16:56:18 4535 [ERROR] /usr/sbin/mysqld: Table './mylife/wp_options' is marked as crashed and should be repaired

MySQL CLIでもこれを行いました。

mysql> use mylife;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    1

mylife DBにはInnoDBテーブルがあります。

ベストアンサー1

破損したテーブルがあります。innodb_force_recovery通常のMySQLの起動に使用するのに適しておらず、innodb_force_recovery誤った値に設定されているため、MySQLの実行が中断されます。

MySQLログから:

  • WordPressデータベーステーブル/mylife/wp_optionsが破損しているとマークされます。
  • innodb_force_recovery無効な値に設定してください。

innodb_force_recovery1に設定してMySQLを起動します。可能テーブルを手動で回復できますが、MySQLは正しく起動しません。

次のコマンドで始めます。

/usr/sbin/mysqld --skip-grant-tables --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/HOSTNAME.pid --skip-external-locking --port=3306 --socket=/var/lib/mysql/mysql.sock

次に、次のようにします。

# mysql
> use mylife;
> repair table wp_options;
> exit;

今、削除するそのinnodb_force_recovery設定。後で MySQL を再起動できます。

参考までに以下を参照してください。mysql Innodb - 'users'テーブルがクラッシュしたとマークされ、修正する必要があります。

MySQLがテーブルを復元できない場合(低可能性)またはテーブルファイルを手動で復元する場合は、MySQLが起動する前にデータベースダンプからwp_optionsテーブルを復元する必要があります。 InnoDBテーブルは、MyISAMなどの別々のテーブルファイルに復元されません。これは人々が頻繁に犯す間違いです。

関連ログ:

InnoDB: !!! innodb_force_recovery is set to 3 !!!  
[ERROR] /usr/sbin/mysqld: Table './mylife/wp_options' is marked as crashed and should be repaired

また、このオプションを使用する場合は、--skip-name-resolve次のログに従ってDNS名ではなくIPアドレスで認証する必要があります。これは警告であり、以前の設定の残余である可能性があります。しかし、あなたの質問に対するより良い文脈がな​​いため、何を言うべきかわかりません。

[Warning] 'user' entry '[email protected]' ignored in --skip-name-resolve mode.
[Warning] 'user' entry '@v4452.vir.kagoya.net' ignored in --skip-name-resolve mode.
[Warning] 'proxies_priv' entry '@ [email protected]' ignored in --skip-name-resolve mode.

別のPIDをインポートする場合サービスが中断または再起動された場合、後続の実行ごとに異なるPIDを取得するのは通常の動作です。

おすすめ記事