你可以通过连接到PostgreSQL数据库的另一个已知存在的用户(如默认的“postgres”用户),并查询现有的角色来检查该角色是否存在。使用以下SQL命令查询角色列表: sql \c postgres -- 连接到postgres数据库(默认数据库) \du -- 列出所有数据库角色 如果你没有访问任何数据库的权限,你将无法执行上述命令,此时需要尝试使...
在docker里操作postgres数据库时遇到这个错误,大意是“postgres”这个角色不存在。 1.解决办法 我们输入下面命令 psql -U onlinejudge 然后依次输入下面两行代码: createuserpostgres superuser;createuserroot superuser; 然后输入 \q 退出即可
postgres=#create user root with password 'password'; CREATE ROLE # 将数据库权限赋予root用户 postgres=# GRANT ALL PRIVILEGES ON DATABASE mydatabase to root; GRANT # 将用户修改为超级用户(看实际需求) postgres=# ALTER ROLE root WITH SUPERUSER; postgres=# \q 也可以直接将root创建为超级用户,login...
报错信息“psql: FATAL: role "postgres" does not exist” 异常分析 通过上述异常分析,Fayson猜测可能是由于CDSW升级后考虑到PG数据库的安全问题,从而将postgres用户的role删除了。像前面通过访问后台数据库查看CDSW用户审计日志一样就属于非法操作,可能就是为了防止Fayson这种不合常规的操作。 既然不能够通过切换到postg...
http://stackoverflow.com/questions/15301826/psql-fatal-role-postgres-does-not-exist 实际上做的事情就是login in 用别的帐号 然后,在postgres的虚拟机里(而不是terminal) CREATE USER postgres SUPERUSER; 1. 实际上这个对我来说就够了。解决了 role does not exist的问题。
如何排查容器中 psql -U " role does not exist" 错误的思路求助? 我使用windows11 上的 docker-desktop 4.12.0 (85629),按照如下方式运行 postgres: docker run -d -p 5432:5432 -v D:\WorkSpaces\postgres\pgdata:/var/lib/postgresql/data -e POSTGRES_USER="postgres" -e POSTGRES_PASSWORD="postgres...
psql: FATAL: role "postgres" does not exist什么原因?这是没有postgres账号呀,你的Windows下pg的...
psql: FATAL: role "postgres" does not exist什么原因?这是没有postgres账号呀,你的Windows下pg的...
Thank you for the explanations! However, I do not understand what I have to change in my docker-compose file, it looks correct to me. Do you see something that needs to be changed? From your error message, it seems like your application might be hard-coded topostgresinstead of reading ...
Ifuseris really the DB superuser you can create another DB superuser and a private, empty database for him: CREATEUSERpostgres SUPERUSER;CREATEDATABASE postgresWITHOWNER postgres; But since your postgres.app setup does not seem to do this, you also should not. Simple adapt the tutorial....