Node.js 具有角色的postgres createdb raise错误的节点不存在
我正在使用postgresql在节点中构建api。我使用sequelize作为ORM。当我运行以下命令创建数据库时:Node.js 具有角色的postgres createdb raise错误的节点不存在,node.js,postgresql,Node.js,Postgresql,我正在使用postgresql在节点中构建api。我使用sequelize作为ORM。当我运行以下命令创建数据库时: createdb bookstore 我遇到以下错误: createdb: could not connect to database template1: FATAL: role "ubox18" does not exist 下面是我的配置文件: { "development": { "username": "postgres", "password
createdb bookstore
我遇到以下错误:
createdb: could not connect to database template1: FATAL: role "ubox18" does not exist
下面是我的配置文件:
{
"development": {
"username": "postgres",
"password": "postgres",
"database": "bookstore",
"port": 5432,
"host": "127.0.0.1",
"dialect": "postgres"
},
"test": {
"username": "postgres",
"password": "postgres",
"database": "database_test",
"host": "127.0.0.1",
"dialect": "postgres"
},
"production": {
"username": "postgres",
"password": "postgres",
"database": "database_production",
"host": "127.0.0.1",
"dialect": "postgres"
}
}
有人能帮我解决我这里缺少的问题吗?试试:
createdb -U postgres bookstore
“createdb”实用程序从操作系统用户中选择数据库用户,除非您使用选项-U通过this或this选择另一个数据库用户