Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 具有角色的postgres createdb raise错误的节点不存在_Node.js_Postgresql - Fatal编程技术网

Node.js 具有角色的postgres createdb raise错误的节点不存在

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

我正在使用postgresql在节点中构建api。我使用sequelize作为ORM。当我运行以下命令创建数据库时:

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选择另一个数据库用户