実現したいこと
-MySQL Workbenchを用いてAWSのRDSのデータベースへの接続
前提
AWSを使っている
Amazone Linux 2
データベースは既に作成しており、接続ができることを確認(後述)
発生している問題・エラーメッセージ
・設定後のテスト接続では、何も反応がなかったり、「unable to connect to localhost」と表示されたりする
・通常の接続では、下記のメッセージが出る
Cannot Connect to Database Server
Your connection attempt failed for user 'admin' to the MySQL server at
wordpressdb.cbasoedqfhgw.ap-northeast-1.rds.amazonaws.com:3306:
Unable to connect to localhost
Please:
1 Check that MySQL is running on address
XXXXXXX.cbasoedqfhgw.ap-northeast-1.rds.amazonaws.com
2 Check that MySQL is reachable on port 3306 (note: 3306 is the
default, but this can be changed)
3 Check the user admin has rights to connect to
XXXXXXX.cbasoedqfhgw.ap-northeast-1.rds.amazonaws.com from
your address (MySQL rights define what clients can connect to the
server and from which machines)
4 Make sure you are both providing a password if needed and using
the correct password for
XXXXXXX.cbasoedqfhgw.ap-northeast-1.rds.amazonaws.com
connecting from the host address you're connecting from
試したこと
・エンドポイント、Username、Passwordは全て正しい
・SSHでEC2へ接続して、当該DataBaseへの接続は成功している
・MySQL Workbenchを用いてほかのデータベースへの接続は成功@Port:3306(MySQL Workbenchやインターネットに問題はない)
・RDSインスタンスの「Public accessibility」も「Yes」に
・セキュリティグループも正しく設定しているはず(やけくそになり、全てのトラフィックを全てのPort、全てのIPをIP4と6両方を許可するような設定にしてみた)(勉強用のアカウントなので、セキュリティー上の懸念はない)
補足情報(FW/ツールのバージョンなど)
エンドポイントをPINGしてみると、
EC2のエンドポイントへのPINGへ変わり、要求がタイムアウトし、100%損失、
だがネットで調べると、これは別に問題ではなさそう
追伸
僕は、サーバに関する知識もAWSに関する知識も素人で、買った本に従ってステップバイステップで勉強しており、トラブルはネットで調べるなり、ChatGPTに聞くなり、解決してきましたが、この問題だけはどうにもなりませんでしたでの、助けてください。
よろしくお願いいたします。