有时候需要在容器内部执行SQL语句,具体操作如下:
进容器后:
psql: error: could not connect to server: FATAL: role "root" does not exist
root@xxxx:/usr/lib/postgresql/12/bin# ./psql -U postgres -h 127.0.0.1 数据库名
本文介绍了如何在容器中解决PostgreSQL中由于角色未创建导致的连接错误,步骤包括切换到postgres用户并使用适当命令行。
有时候需要在容器内部执行SQL语句,具体操作如下:
进容器后:
psql: error: could not connect to server: FATAL: role "root" does not exist
root@xxxx:/usr/lib/postgresql/12/bin# ./psql -U postgres -h 127.0.0.1 数据库名
1681
4867
487

被折叠的 条评论
为什么被折叠?