Title: MySQL on RDS Instance
Last modified: September 1, 2016

---

# MySQL on RDS Instance

 *  [theyuv](https://wordpress.org/support/users/theyuv/)
 * (@theyuv)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/mysql-on-rds-instance/)
 * I want to install WordPress on an existing AWS ec2 instance. However, I get an
   error: “Error establishing database connection”.
 * I followed the tutorial [here](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hosting-wordpress.html).
 * The only difference is that the tutorial is for people who are installing MySQL
   on the same ec2 instance while I wish to have MySQL run on a separate instance(
   ie: RDS).
 * The steps I carried out:
 * 1) Installed the httpd24, php56 and php56-mysqlnd packages on the ec2 instance.
 * 2) Created a MySQL user with privileges and db:
 *     ```
       CREATE USER 'wordpress-user'@'localhost' IDENTIFIED BY 'your_strong_password';
       GRANT ALL PRIVILEGES ON wordpress_db.* TO "wordpress-user"@"localhost";
       ```
   
 * 3) Filled out the wp-config values with the appropriate values:
 *     ```
       define('DB_USER', 'wordpress-user'); //without the "@'localhost'" part
       define('DB_HOST', '[RDS endpoint]:3306');
       ```
   
 * 4) The rest of the instructions outlined in the tutorial (allow permalinks and
   file permissions for Apache web server).
 * However, when I enter the url of the WordPress blog I get the error: “Error establishing
   database connection”.
 * Does anyone have any suggestions for what’s wrong with my setup?
 * Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [theyuv](https://wordpress.org/support/users/theyuv/)
 * (@theyuv)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/mysql-on-rds-instance/#post-7704466)
 * I got this working by creating the user on all (ie: `'%'`) hosts rather than 
   just localhost.
 *  [citra](https://wordpress.org/support/users/citra/)
 * (@citra)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/mysql-on-rds-instance/#post-7704532)
 * Thanks for sharing the info. I currently have MySQL on the same ec2 server as
   my WordPress but plan to move it to RDS in the near future.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘MySQL on RDS Instance’ is closed to new replies.

## Tags

 * [aws](https://wordpress.org/support/topic-tag/aws/)
 * [database](https://wordpress.org/support/topic-tag/database/)

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 2 replies
 * 2 participants
 * Last reply from: [citra](https://wordpress.org/support/users/citra/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/mysql-on-rds-instance/#post-7704532)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
