• 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.

    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

    (@theyuv)

    I got this working by creating the user on all (ie: '%') hosts rather than just localhost.

    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.