0
sequelize db:migrate
打印出:
Sequelize [Node: 6.9.4, CLI: 2.4.0, ORM: 3.24.6]
Loaded configuration file "config\development.json".
Unable to connect to database: SequelizeConnectionRefusedError: connect ECONNREFUSED 127.0.0.1:3306
然後在看看配置/ development.json我看到:
{
"development": {
"username": "postgres",
"password": "password",
"database": "mydb",
"host": "127.0.0.1",
"port": "5432",
"dialect": "postgres"
},
"test": {
"username": "postgres",
"password": "password",
"database": "mydb",
"host": "127.0.0.1",
"port": "5432",
"dialect": "postgres"
},
"production": {
"username": "postgres",
"password": "password",
"database": "mydb",
"host": "127.0.0.1",
"port": "5432",
"dialect": "postgres"
}
}
爲什麼?爲什麼sequelize仍然試圖去mysql端口? ialso添加了端口,您可以在配置文件中看到。我找不到任何資源說不支持postgres。但似乎sequelize-cli仍然不關心方言,甚至不關心我在config-file中輸入的端口號。