postgresql - FATAL: password authentication failed for user postgres aurora
问题描述
If I create a user logged in as postgres to the root db and create a user... it doesn't work. What am I doing wrong?
postgres=> CREATE ROLE myUser WITH LOGIN PASSWORD 'xxx';
CREATE ROLE
postgres=> GRANT CONNECT ON DATABASE myDatabase TO myUser;
GRANT
postgres=> GRANT USAGE ON SCHEMA public to myUser;
GRANT
postgres=> GRANT SELECT ON ALL TABLES IN SCHEMA public TO myUser;
GRANT
When I go to authenticate I get an error. psql -h $dbURL -U myUser myDatabase
FATAL: password authentication failed for user myUser
解决方案
The user you created is "myuser", because case is ignored for SQL identifiers not within double quotes, and folded to lower case. But case is not ignored in command-line tools, so you are trying to log in as non-existent user "myUser". Since non-existent users don't have a password hash, password authentication must fail.
推荐阅读
- javascript - 从不同的父级中删除类
- python-3.x - PythonPDF: FileNotFoundError: [WinError 2] 系统找不到指定的文件
- java - 覆盖问题:当存储在 ArrayList 中时,第一个地图被第二个覆盖,因此可以看到第二个地图两次
- java - 如何动态设置activiti任务名称?
- r - 如何将 Youtube 视频插入闪亮的应用程序?
- php - Laravel 8 迁移工作,但 MySQL 拒绝连接
- jpa - 如何避免 JPA 持久化直接插入数据库?
- php - 我想根据数据库中的记录限制底部的页码分页。我给出了条件,但它不起作用。请检查一下
- javascript - 从导入的 React 组件访问变量
- java - 在java aws lamba中使用rest Temple调用另一个第3方rest api时连接超时