View a markdown version of this page

Connection and sign-in errors - Amazon Aurora

Connection and sign-in errors

When you connect to the routing endpoint of a database cluster group for Aurora, the routing layer signs you in as a router user. You sign in with a password. Each statement then runs on a member cluster as the member cluster user of the same name. Use the following table to find the cause of an error with the connection, the sign-in, or the privileges of either user. For what to do about each error, see Fixing connection and sign-in errors by code. For causes and fixes by symptom, see Troubleshooting connection and sign-in problems.

Connection and sign-in error codes

The following table lists one error in each row. In a message, <USER_NAME> is the router user name and <HOST> is its host part.

Aurora MySQL code (SQLSTATE) Message Cause
1045 (28000) Access denied for user '<USER_NAME>'@'<HOST>' (using password: YES) The routing layer didn't accept the sign-in. No router user has this user name, no host part matches the client IP address, the password is wrong, or the router user is set to REQUIRE SSL and the connection doesn't use TLS.
1045 (28000) Access denied for user '<USER_NAME>'@'<HOST>' (using password: NO) The client sent no password.
1045 (28000) Access denied for user '<USER_NAME>'@'<HOST>' (no matching account on cluster) The sign-in at the routing endpoint succeeded, and a member cluster refused the impersonated login of the router user, because no member cluster user of the same name exists there. The client stays connected, and statements fail only for the member clusters that the session reaches. Create the member cluster user, with the same name, on that member cluster.
1040 Too many connections, or Connection rate limit exceeded: more than <N> new connections per second. Retry with backoff. A new connection exceeded the routing layer's limit on open client connections, or on new connections per second. The routing layer sends the error in place of the server greeting, before sign-in, and closes the connection.
3118 (HY000) Access denied for user '<USER_NAME>'@'<HOST>'. Account is locked. The credentials are correct, and the router user is locked. The routing layer checks the lock only after it accepts the credentials, so a wrong password for a locked router user returns error 1045.
1862 (HY000) Your password has expired. To log in you must change it using a client that supports expired passwords. The router user's password has expired, and the client doesn't support expired passwords. The routing layer checks expiry last, after the credentials, the account lock, and TLS. Change the password with ALTER USER from a client that supports expired passwords, such as the mysql client.
2061 (client) Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection. The router user uses caching_sha2_password, the connection doesn't use TLS, and the sign-in needs a full authentication, for example the first sign-in after a password change or after the routing layer restarts.
2013 (client) Lost connection to MySQL server at 'reading authorization packet', system error: N The routing layer closed the connection during sign-in and sent no error, because it couldn't read the router user, or because the client didn't finish the sign-in before a timeout.
3159 (HY000) Connections using insecure transport are prohibited while --require_secure_transport=ON. The connection doesn't use TLS. On Aurora MySQL, the routing layer returns this error after the credential and account-lock checks, so a wrong password reports the sign-in error first. The routing endpoint accepts only TLS 1.2 and TLS 1.3.
2013 (client) Lost connection to MySQL server during query The routing layer closed the connection and sent no error, so the client reports the error on its next statement. The routing layer closes a connection at its idle close, also when the idle session has an open transaction. It also closes the routed sessions that use a member cluster whose writer fails over or restarts, for example during an upgrade. It closes the routed sessions whose last statement went to a member cluster that you remove from the group. The member cluster session ends, and the member cluster rolls back an open transaction.
1396 (HY000) Plugin 'AWSAuthenticationPlugin' is not a supported authentication plugin IAM database authentication for router users isn't available at preview. A CREATE USER or ALTER USER statement at the routing endpoint names AWSAuthenticationPlugin. For more information, see IAM database authentication.
1524 (HY000) Plugin '<PLUGIN>' is not loaded The router user is stored with an authentication plugin that the routing layer doesn't support.
1227 (42000) Access denied; you need the '<DBCLUSTERGROUP_PRIVILEGE>' privilege for this operation, or Access denied; unknown privilege '<PRIVILEGE>' An operation at the routing endpoint ran without the privilege for database cluster groups for Aurora that it needs, or a GRANT at the routing endpoint named a data privilege. A GRANT at the routing endpoint accepts only these privileges.
1396 (HY000) String '<value>' is too long for user name (should be no longer than 32), or String '<value>' is too long for host name (should be no longer than 255) The user part of a router user name is longer than 32 characters, or the host part is longer than 255 characters. Length is counted in characters, not bytes.
1105 (HY000) The router could not open a session for this connection The credentials were accepted, and the routing layer couldn't open the session, for example because it couldn't read the group's metadata for the router user. The routing layer sends the error in place of the sign-in's OK and closes the connection. Retry the connection with backoff.
4031 (HY000) Connection closed: maximum connection lifetime reached An idle connection reached the routing layer's maximum connection lifetime, and the routing layer closed it. A connection that has a statement running closes with no error. For more information, see Idle close and connection lifetime.
1053 (08S01) The pinned target is unreachable; reconnect and pin again The member cluster session of a pinned session ended, for example after a KILL on the member cluster. The routing layer doesn't reconnect a pin, so it closes the connection.
1927 (70100) Connection was killed A member cluster session ended while the session had an open transaction, a running statement, or prepared statements on it. The member cluster rolled back an open transaction, and the routing layer closes the connection. For more information, see Session and transaction errors.
The member cluster's own error, such as 1142 (42000) or 1044 (42000) The member cluster's message, such as <COMMAND> command denied to user '<USER_NAME>'@'<HOST>' for table '<TABLE>' or Access denied for user '<USER_NAME>'@'<HOST>' to database '<DATABASE>' The member cluster user exists, and it lacks the privilege that the statement or the pin needs on that member cluster. The routing layer passes the member cluster's error through, and the connection stays open. Grant the privilege to the member cluster user over a direct connection to that member cluster. When no member cluster user of that name exists, the error is 1045 with (no matching account on cluster).

The texts of client errors 2061 and 2013 in this table are those of libmysqlclient, which the mysql client uses. Other drivers report the same codes with their own text.