PostgreSQL, SQL Shell(psql) psql: error: could not connect to server: fe_sendauth: no password supplied.

问题描述 投票:0回答:1

SQL shell(psql)在提示用户postgress的密码时抛出了这个错误 psql: error: could not connect to server: fe_sendauth: no password supplied.

尝试CMD C:\Users\myuser>psqlPassword for user myuser:psql: error: could not connect to server: fe_sendauth: no password supplied.

C:\Users\myuser>psql -U postgresPassword for user postgres:psql: error: could not connect to server: FATAL: "postgres "用户的密码认证失败。

找到了这个 1.答案:可能是pgpass.conf文件需要把它放到PostgreSQL服务器上,而不是放在pgAdmin(客户端的dir)?

pgAdmin 4的工作就好了,问题是psql的shell

im在WIN 10上,有人有同样的问题和如何解决它?

PS:我设法通过设置pg_hba.config文件来工作psql shell。

主机全部 127.0.0.132 md5

在IP4和IP6中,我设置了trust instade md5并重新编码了Postgress服务,但当我将新的密码设置为md5后又恢复了,出现了同样的问题和错误。

psql: error: could not connect to server: fe_sendauth: no password supplied.

pgAdmin 4仍然可以工作

sql postgresql passwords psql
1个回答
0
投票

我已经安装和卸载了很多次,我已经成功地得到了下图所示的理想结果......

enter image description here

  1. 安装 邮局 除了输入新的密码外,不做任何更改,在Windows搜索菜单中输入'psql'打开sql shell。
  2. 在SQL shell中,一直按回车键,直到它提示你输入你在安装程序中创建的密码。
  3. 在这里输入你的密码,即使它看起来不像是被输入的,完成后按回车键。

它应该看起来像...

Server [localhost]:
Database [postgres]:
Port [5432]:
Username [postgres]:
Password for user postgres:
psql (12.2)

WARNING: Console code page (850) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page "Notes for Windows users" for details.
Type "help" for help.

postgres=# 
  1. 从这个链接安装pgadmin pgadmin从psql中输入密码,然后你应该看到以下内容......

enter image description here

  1. 点击左上角的服务器数据库图标,添加你在psql中输入的密码。
  2. 创建一个数据库,得到列表。

    postgres=# CREATE DATABASE your_database_name OWNER postgres; #Click enter here
    CREATE DATABASE #result
    postgres=# \l #to get the below datbase list
    

enter image description here

  1. 回到pg admin,刷新浏览器,点击服务器图标。

注意事项 如果你需要卸载re-install,你将需要手动删除安装Postgres和pgadmin的文件夹。这甚至是在从系统设置中卸载之后。由于某些原因,Postgres文件夹的不完全删除,即使你选择了这个选项。

© www.soinside.com 2019 - 2024. All rights reserved.