Wordpress和phpMyAdmin无法打开RDS数据库 [英] Wordpress and phpMyAdmin cannot open a RDS database
问题描述
我使用带有MariaDB的CentOS 7在EC2上创建了一个WordPress多站点.
I created a WordPress multisite on an EC2 using CentOS 7 with MariaDB.
令人惊讶的是它起作用.
Amazingly it works.
我按照说明在这里 上传数据库 我可以从命令行使用MySQL附加并查看RDS数据库.
I followed the instructions here to upload the database using MySQL from a command line I can attach to and see the RDS database.
MariaDB [(无)]>显示数据库;
MariaDB [(none)]> SHOW databases;
+--------------------+
| Database |
+--------------------+
| WPDB01 |
| information_schema |
| innodb |
| mysql |
| performance_schema |
+--------------------+
MariaDB [(无)]>从mysql.user中选择用户,主机";
MariaDB [(none)]> select User, Host from mysql.user;
+-----------------+-----------+
| User | Host |
+-----------------+-----------+
| WordPressAbuser | % |
| WordPressUser | % |
| rdsadmin | localhost |
+-----------------+-----------+
所以我知道端口是开放的,数据库在那里.
So I know the ports are open and the database is there.
但是将wp-config.php
内部的localhost更改为mymariadb.xyz.us-east-1.rds.amazonaws.com
无效.
But changing localhost inside of wp-config.php
to mymariadb.xyz.us-east-1.rds.amazonaws.com
does not work.
我在做什么错了?
推荐答案
检查您的EC2安全组是否已附加到RDS安全组?
Check if Your EC2 security group is attached to RDS security group?
您的RDS应该具有一个新的单独的安全组,并且在源中必须添加ec2安全组.
Your RDS should have a new separate security group and in the source, you have to add ec2 security group.
应该将rds安全组附加到您的rds实例 ec2安全组应附加到相应的ec2实例
that rds security group should be attached to you rds instance the ec2 security group should attach to the corresponding ec2 instance
然后尝试连接
这篇关于Wordpress和phpMyAdmin无法打开RDS数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!