Connect WordPress to the New RDS Database
Learn to connect our WordPress EC2 instance to the RDS database.
Now that we have set up the MariaDB RDS database, it’s time to test its connection. Once we know the connection is working, we can change the configuration of our WordPress instance to use the MariaDB RDS database instead of the built-in MariaDB database running on the WordPress instance.
Identify the endpoint of our database
To test the connection, we first need to find out the endpoint (the DNS name) of the RDS database. We can use the describe-db-instances
command for this.
The parameters are as follows:
--db-instance-identifier
to refer to the database (we gave it the identifierwordpress-db
).--query
to filter the output. This time we are interested in theDBInstances[0].Endpoint.Address
value.--output text
to return the result as plaintext.
The full command looks like this:
Get hands-on with 1400+ tech skills courses.