简体   繁体   English

无法连接到 AWS 上的 mysql RDS 实例

[英]Cannot connect to the mysql RDS instance on AWS

I created a MySQL RDS instance on AWS.我在 AWS 上创建了一个 MySQL RDS 实例。 I also created an EC2 instance on which I installed Wordpress, Apache, MySQL client, and other dependencies using the script shown below.我还创建了一个 EC2 实例,在该实例上安装了 Wordpress、Apache、MySQL 客户端和其他依赖项,使用如下所示的脚本。

-- Script - 脚本

#!/bin/bash

yum update -y

yum install httpd php php-mysql -y

cd /var/www/html

echo "healthy" > healthcheck.html

wget https://wordpress.org/wordpress-5.1.1.tar.gz

tar -xzf wordpress-5.1.1.tar.gz

cp -r wordpress/* /var/www/html/

rm -rf wordpress

rm -rf wordpress-5.1.1.tar.gz

chmod -R 755 wp-content

chown -R apache:apache wp-content

chkconfig httpd on

service httpd start

I created a database and a master user while creating an RDS instance, and tried to host a Wordpress website.我在创建 RDS 实例时创建了一个数据库和一个主用户,并尝试托管一个 Wordpress 网站。 It shows this error every time ( This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at wpsdbserver.cv3al69dy8rq.us-east-1.rds.amazonaws.com. This could mean your host's database server is down ).它每次都显示此错误(这意味着您的 wp-config.php 文件中的用户名和密码信息不正确,或者我们无法联系 wpsdbserver.cv3al69dy8rq.us-east-1.rds.amazonaws 上的数据库服务器。 com。这可能意味着您主机的数据库服务器已关闭)。

Both EC2 instance and RDS instance are in the same VPC, and also I have allowed port 3306 from SecurityGroup1(Ec2) to SecurityGroup2(Rds instance). EC2 实例和 RDS 实例都在同一个 VPC 中,并且我还允许从 SecurityGroup1(Ec2)到 SecurityGroup2(Rds 实例)的端口 3306。 I have entered the correct username, password, and database endpoint.我输入了正确的用户名、密码和数据库端点。 RDS instance has no public access. RDS 实例没有公共访问权限。 The rest of the configuration settings are set to default.配置设置的 rest 设置为默认值。

Based on the comments.根据评论。

The issue was caused by the use of MySQL 8 .该问题是由使用MySQL 8引起的。 MySQL introduced some changes that causes wordpress not to work out of the box. MySQL 引入了一些更改,导致 wordpress 无法开箱即用。 It has been reported several times before along with potential fixes, eg here , here or here .之前已经多次报告过它以及潜在的修复,例如这里这里这里

The easiest way to overcome this issue is to use MySQL 5.7 which works out of the box with Wordpress.解决此问题的最简单方法是使用MySQL 5.7 ,它与 Wordpress 一起开箱即用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM