简体   繁体   中英

AWS: Not able to connect to mysql(rds) from wordpress

I'm trying to connect to mysql instance on rds via worpress, but I get this error:

Warning: mysql_connect(): Unknown MySQL server host '***********************' (111) in /var/www/html/wp-includes/wp-db.php on line 1568

Error establishing a database connection...

As I have read, (111) is for permission error. But I'm able to connect to the instance via workbench. In fact I was able to connect via wordpress earlier too.

This is driving me crazy. Please help. (My wp-config.php is correct. Checked it a 1000 times)

The following checks have to be done:

  1. The subnet group for RDS needs to have inbound traffic enabled from the subnet group that has the WordPress server installed.

  2. Make sure all NACL rules that control traffic between the subnets are not blocking this traffic

  3. The WP server subnet group should not be blocking outgoing traffic to the RDS group. If needed add the RDS subnet group to the outgoing traffic from the EC2 instance hosting the WP server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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