[英]FATAL: password authentication failed for user "postgres" While connecting to postgres
I tried to create server it it says:我试图创建服务器它说:
Unable to connect to server:无法连接到服务器:
FATAL: password authentication failed for user "postgres"致命:用户“postgres”的密码验证失败
What operating system are you using?您使用什么操作系统? maybe you need to change the password of the postgres user.
也许您需要更改 postgres 用户的密码。 In my case I use Debian GNU Linux, to change the password of the postgres user, I do it in the following way:
就我而言,我使用 Debian GNU Linux 来更改 postgres 用户的密码,我按以下方式进行:
root@alpha:~$ passwd postgres
and then I enter a new password for the user.然后我为用户输入一个新密码。
Could you also verify that the postgres
user has permission to connect to the server?您是否还可以验证
postgres
用户是否有权连接到服务器? To do this, you can check the pg_hba.config
file in the PostgreSQL.为此,您可以检查 PostgreSQL 中的
pg_hba.config
文件。 installation directory.安装目录。
root@alpha:~$ nano /etc/postgresql/11/main/pg_hba.conf
By default PostgreSQL, only allows connections from local addresses (localhost)默认情况下 PostgreSQL,只允许来自本地地址 (localhost) 的连接
Make sure to have your local postgres server running确保您的本地 postgres 服务器正在运行
Hit pgadmin tool connect to server and to create database点击 pgadmin 工具连接到服务器并创建数据库
Right-click on the server button to your left, select create then server, insert name of the server, make sure it is as descriptive as possible, that way you can find your way back to if you remember右键单击左侧的服务器按钮,选择创建然后服务器,插入服务器的名称,确保它尽可能具有描述性,这样您就可以在记得时找到返回的方法
Move to connection tab;移动到连接选项卡; host name is the server where the SQL database is running, most likely you will be starting with your machine as database(db), insert localhost or 127.0.0.1.
主机名是运行 SQL 数据库的服务器,很可能您将使用您的机器作为数据库(db),插入 localhost 或 127.0.0.1。
leave default port as it is '5432' maintenance db leave as 'postgres' username leave as default 'postgres' password : same as you registered with during installation保留默认端口为“5432”维护数据库保留为“postgres”用户名保留为默认“postgres”密码:与您在安装过程中注册的相同
To your left, you should see the database under 'server', you should see the postgres default created underlink databases.在您的左侧,您应该会看到“服务器”下的数据库,您应该会看到 postgres 默认创建的下链接数据库。
Right click on the databases button and select create, then database, insert your descriptive database name, click save.右键单击数据库按钮并选择创建,然后选择数据库,插入您的描述性数据库名称,单击保存。
Click on your new database, roll down, highlight Schema, go to Tools, select Query Tool...单击您的新数据库,向下滚动,突出显示架构,转到工具,选择查询工具...
You can go ahead to create or import tables as you deem fit.您可以继续创建或导入您认为合适的表格。
EMPHASIS SHOULD BE ON THE PASSWORD, IT MUST BE SAME AS USED DURING INSTALLATION重点应该在密码上,它必须与安装时使用的相同
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.