使用TypeOrm和AWS RDS Aurora MySQL实例的``握手不活动超时''

时间:2018-09-30 14:39:21

标签: mysql amazon-web-services typeorm

尝试使用TypeOrm连接到AWS RDS Aurora DB MySQL,这会给我Handshake inactivity timeout错误。

code: 'PROTOCOL_SEQUENCE_TIMEOUT',
fatal: true,
timeout: 10000

尝试使用默认的10秒和我自己的15秒超时。

ormconfig.json文件:

{
    "type": "mysql",
    "host": "host connection string",
    "port": 3306,
    "username": "xxxx",
    "password": "xxxx",
    "database": "xxxx",
    "synchronize": true,
    "logging": true,
    "connectTimeout": 15000,
    "entities": [
       "src/entity/**/*.ts"
    ],
    "migrations": [
       "src/migration/**/*.ts"
    ],
    "subscribers": [
       "src/subscriber/**/*.ts"
    ],
    "cli": {
       "entitiesDir": "src/entity",
       "migrationsDir": "src/migration",
       "subscribersDir": "src/subscriber"
    }
}

能够使用Linux MySQL客户端CLI连接到实例,甚至尝试在同一VPC中使用ECS连接到数据库,但出现相同的错误。

1 个答案:

答案 0 :(得分:0)