Centos 7 OS を搭載した Linux サーバーで MySQL を起動できない

Centos 7 OS を搭載した Linux サーバーで MySQL を起動できない

次のコマンドで、サーバー (Centos 7) に MySQL をすでにインストールしています。

yum install -y mysql
yum install -y mysql-server
yum install -y mysql-devel

インストール後、入力するmysqlとエラーが発生します

ERROR 2002 (HY000): Can't connect to local MySQL server through socket 
'/var/mysql/mysql.sock' (2)

MySQLサービスをまだ開始していないためだと思うので、次のコマンドを入力します。

service mysqld start

すると、次のようなメッセージが届きましたJob for mariadb.service failed

以下は/etc/my.cnf

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid

しかし、私のサーバーにはそのファイル/var/lib/mysql/mysql.sockは存在しません。ちなみに、SELINUX は手動で無効にされています。

mariadb.logショー

InnoDB: Error: log file ./ib_logfile0 is of different size 0 50331648 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
InnoDB: Possible causes for this error:
   (a) Incorrect log file is used or log file size is changed
   (b) In case default size is used this log file is from 10.0
   (c) Log file is corrupted or there was not enough disk space
   In case (b) you need to set innodb_log_file_size = 48M
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGIN failed.
[ERROR] Unknown/unsupported storage engine: innodb
[ERROR] Aborting

答え1

この問題を解決したので、自分で回答したいと思います。この自己回答行為が適切でない場合は、以下にコメントしてください。

/var/log/mariadb/maridb.log全体として、ファイルにリストされている問題を理解することでこの問題を解決します。

まず、ファイル./ib_logfile0内でサイズ制限を超えていると指摘されている を削除します。次に、 をmariadb に+logしようとしましたが、再び失敗します。と表示されます。間違ったファイルをバックアップして mysql を再起動すると、maridb は最終的に正常になります。enablestartsystemctlmaridb.logIncorrect information in file './mysql/proxies_priv.frm'

関連情報