Skip to content

How do I troubleshoot issues when I connect to Amazon Aurora?

3 minute read
0

I can't connect to my Amazon Aurora MySQL-Compatible DB cluster or DB instance.

Resolution

To resolve common connection issues with Aurora DB instances, see How do I troubleshoot issues when I connect to my Amazon RDS DB instance?

For Aurora DB clusters, make sure that your client connects to the correct endpoint. You must use MySQL or PostgreSQL client tools to connect to Aurora DNS endpoints.

Verify your connection to the Aurora endpoint

To check the DB cluster writer, reader, and custom endpoints that your client connects to, complete the following steps:

  1. Open the Amazon RDS console.
  2. In the navigation pane, choose Databases.
  3. Select your DB cluster, and then under the endpoint section of Connectivity & security, review the DB cluster details.
  4. To verify connectivity to the endpoint, run one of the following commands.
    Run the telnet command:
    telnet RDS-endpoint port-number
    Note: Replace RDS-endpoint with your RDS endpoint and port-number with your port.
    Successful telnet output example:
    [root@ip-172-AB-C-XY ~]# telnet postgres.cluster-ABDCXYZ.us-east-1.rds.amazonaws.com 5432Trying 172.AB.C.XY...Connected to postgres.cluster-ABDCXYZ.us-east-1.rds.amazonaws.com.
    Or, run the following netcat command:
    nc -vz RDS-endpoint port-number
    Note: Replace RDS-endpoint with your RDS endpoint and port-number with your port.
    Successful netcat output example:
    [root@ip-172-AB-C-XY ~]# nc -vz postgres.cluster-ABCDXYZ.us-east-1.rds.amazonaws.com 5432Ncat: Version 7.50 ( https://nmap.org/ncat )Ncat: Connected to 172.AB.C.XY:5432.Ncat: 0 bytes sent, 0 bytes received in 0.01 seconds.
    If you can't connect to the endpoint, then check for DB cluster connection issues or DB instance connection issues.
  5. After you connect, run the following command for your configuration, and then verify that you are connected to a reader or writer endpoint.
    For Aurora MySQL-Compatible, run the following statement:
    SHOW GLOBAL VARIABLES LIKE 'innodb_read_only';
    Expected output for a successful connection to a writer endpoint:
    innodb_read_only | OFF
    Expected output for a successful connection to a reader endpoint:
    innodb_read_only | ON
    For Aurora PostgreSQL-Compatible, run the following statement:
    SHOW transaction_read_only;
    Example output for a successful connection to a writer endpoint:
    transaction_read_only-----------------------
     off
    Example output for a successful connection to a reader endpoint:
    transaction_read_only-----------------------
     on
    Note: If the variable is set to ON, then your DB cluster or instance connects to an Aurora replica. If the variable is set to OFF, then your DB cluster or instance connects to the primary instance.

(Optional) Set up an automatic connection to your DB instance from an Amazon EC2 instance

You can establish a connection to your DB instance from an Amazon Elastic Compute Cloud (Amazon EC2) instance. Before you set up this connection, make sure that your configuration meets the automatic connection requirements. Then, set up an automatic connection to your DB instance from your EC2 instance.

Note: If you use an Aurora database, then select your DB cluster instead of your DB instance.

Related information

Troubleshooting connection issues for Aurora MySQL databases

Security in Amazon RDS

Managing security responsibilities for Amazon Virtual Private Cloud