
次のコマンドで、サーバー (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 は最終的に正常になります。enable
start
systemctl
maridb.log
Incorrect information in file './mysql/proxies_priv.frm'