Create the MySQL Aurora for WordPress

MySQL database (WordPress)

  1. Open AWS Console

  2. In the AWS Console, Navigate to Services > Database, RDS

  3. In the RDS screen, click on Databases, then click on Create Database. create mysqlrds

  4. In Choose a database creation method select Standard Create and, in Engine options use the settings:

    • Engine type: Amazon Aurora
    • Edition: Amazon Aurora with MySQL compatibility
    • Version: Keep the default selected
    • Database location: Regional

    select mysqlrds 1

  5. In Database Features select One writer and multiple readers and, then in Templates select Dev/Test:

    We are using Dev/Test selection on this exercise because there are no active users running the application. For a production environment prefer the Production template.

    select mysqlrds 2

  6. In Settings use the following settings:

    • DB cluster identifier: MID-Wordpress
    • Master username: admin
    • Master password: For EventEngine events use the same Linux password as defined in your team dashboard. If you are using your own AWS account use the same password defined during the CloudFormation launch

    After, in DB Instance size select Burstable classes, so change the size to db.t3.medium select mysqlrds 3

  7. In Availability & durability select Don’t create an Aurora Replica. select mysqlrds 4

  8. In Connectivity change the following settings:

    • Virtual Private Cloud (VPC) to Target
    • Expand Additional connectivity configuration
      • Public accessible select No
      • VPC security group, select Choose existing. Keep default and add the one that contains TargetSecurityGroup in the name.
      • Availability zone select the one that ends with suffix a

    select mysqlrds 5

  9. In Database authentication select Password authentication

  10. Expand Additional configuration

    • DB instance identifier set wordpressdb
    • Initial database name set wordpressdb
    • Encryption uncheck Enable Encryption
    • Monitoring uncheck Enable Enhanced monitoring

    select mysqlrds 6

    select mysqlrds 7

  11. Click on Create database

    Create RDS MySQL

  12. Wait until the Available status: Wait until available status

  13. Click on wordpressdb Writer database and write down the endpoint. We will use it later on this exercise. Write down Wordpress DB endpoint

  14. Connect to the bastion host. If you’re not familiar on how to connect to the bastion host, follow these steps

  15. Once connected to the bastion host, Open on putty: Click on putty

  16. Then, connect to the server wordpress-db. For EventEngine based events, the username and password are in your EventEngine team dashboard. If you are running this lab in your own AWS account, the username is user and the password will be the same that you used as a parameter when you launched the CloudFormation. Connect to wordpress-db

  17. Now, let’s create the wordpress user in your new Aurora database. Run the following command (using the same password that you specified on step 6.) to connect to your Aurora MySQL database:

    mysql -u admin -h <INSERT AURORA DNS VALUE FROM STEP 13> -p
    
  18. Once connected to the mysql console, run the following commands to create the user wordpress. Replace the <USE SAME PASSWORD FROM STEP 6> before running the command:

The command bellow is single quote sensitive. Make sure your text editor doesn’t replace the single quote used bellow

HINT: Use a text editor to arrange the commands before past it into the putty

CREATE USER 'wordpress'@'%' IDENTIFIED BY '<USE SAME PASSWORD FROM STEP 6>';
GRANT ALL ON wordpressdb.* TO 'wordpress'@'%';
FLUSH PRIVILEGES;
QUIT

Create wordpress user in Aurora MySQL