前提・実現したいこと
EC2内で、MySQL 5.7.32 を起動することができません。
ご教授頂ければと思います。よろしくお願いいたします。
発生している問題・エラーメッセージ
以下のコマンドで、ソケットやPIDファイルの存在確認と、権限の修正を済ませました。
[kent@ip-10-0-0-12 ~]$ mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) [kent@ip-10-0-0-12 ~]$ sudo touch /tmp/mysql.sock [sudo] password for kent: [kent@ip-10-0-0-12 ~]$ mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (13) [kent@ip-10-0-0-12 ~]$ sudo chmod 666 /tmp/mysql.sock [kent@ip-10-0-0-12 ~]$ mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)
しかし、最終行にあるように、'/tmp/mysql.sock' (111)' を解決できません。
MySQLのステータスは以下の通りです。
[kent@ip-10-0-0-12 children]$ sudo systemctl status mysqld ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: failed (Result: start-limit) since Thu 2021-03-18 16:29:53 JST; 5s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 8504 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE) Process: 8469 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Mar 18 16:29:52 ip-10-0-0-12.ap-northeast-1.compute.internal systemd[1]: mysqld.service: control process exited, code=exite...s=1 Mar 18 16:29:52 ip-10-0-0-12.ap-northeast-1.compute.internal systemd[1]: Failed to start MySQL Server. Mar 18 16:29:52 ip-10-0-0-12.ap-northeast-1.compute.internal systemd[1]: Unit mysqld.service entered failed state. Mar 18 16:29:52 ip-10-0-0-12.ap-northeast-1.compute.internal systemd[1]: mysqld.service failed. Mar 18 16:29:53 ip-10-0-0-12.ap-northeast-1.compute.internal systemd[1]: mysqld.service holdoff time over, scheduling restart. Mar 18 16:29:53 ip-10-0-0-12.ap-northeast-1.compute.internal systemd[1]: start request repeated too quickly for mysqld.service Mar 18 16:29:53 ip-10-0-0-12.ap-northeast-1.compute.internal systemd[1]: Failed to start MySQL Server. Mar 18 16:29:53 ip-10-0-0-12.ap-northeast-1.compute.internal systemd[1]: Unit mysqld.service entered failed state. Mar 18 16:29:53 ip-10-0-0-12.ap-northeast-1.compute.internal systemd[1]: mysqld.service failed.
MySQLのstart時のエラーは以下の通りです。
[kent@ip-10-0-0-12 children]$ sudo systemctl start mysqld Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
試したこと
①RDSへの接続は可能です。
$ mysql -h エンドポイント -P 3306 -u root -p
②バージョン8.0系でも試しましたが、同様のエラーにつながります。
③ /etc/my.cnf の設定です。
[client] socket=/tmp/mysql.sock # For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html [mysqld] datadir=/tmp/ socket=/tmp/mysql.sock
上記のソケットの設定を socket=/var/lib/mysql/mysql.sock に変えるなどもしましたが、同様のエラーにつながりました。
回答1件
あなたの回答
tips
プレビュー