乐于事 GPLv3+项目(git提交109d5fb90f6ae .)我们需要一个在Debian (Buster) Gnu/Linux86-64上运行的文件~/.pgpass的具体和工作示例。
我们正在进行调试,因此我们需要能够在没有根的情况下做到这一点。
PostGreSQL on Debian/Buster是12版。
我一生中从未部署过任何PostGreSQL数据库。
下面的例子不起作用,我不明白为什么(对法语的评论很抱歉)
# fichier ~/.pgpass pour Basile en mars 2020
# voir https://www.postgresql.org/docs/current/libpq-pgpass.html
localhost:*:helpcovid_db:helpcovid_usr:test_helpcovid只有我才能读到这个文件:
% ls -l .pgpass
-rw------- 1 basilest basilegr 164 Mar 22 12:38 .pgpass5733fed27967d13中得到解决
使用我们的generate-config.py python脚本
PS。https://github.com/bstarynk/helpcovid项目将于2020年3月开始实施,work正在进行
发布于 2020-03-23 20:38:19
我使用Ubuntu,只需遵循https://itsfoss.com/install-postgresql-ubuntu/链接中的postgresql指南即可
然后,在这个项目中,我遇到了一个编译错误,试图使用make localhost0,但是postgresql连接部分与.pgpass的工作方式如下。
developer@1604:~/proj/github/helpcovid$ sudo su - postgres
postgres@1604:~$ psql -c "alter user postgres with password 'StrongPassword'"
ALTER ROLE
postgres@1604:~$ createuser dbuser1
postgres@1604:~$ createdb testdb -O dbuser1
postgres@1604:~$ psql -l | grep testdb
testdb | dbuser1 | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
postgres@1604:~$ psql
psql (11.7 (Ubuntu 11.7-2.pgdg18.04+1), server 9.5.14)
Type "help" for help.
postgres=# alter user dbuser1 with password 'StrongPassword';
ALTER ROLE
postgres=# create table test_table ( id int,first_name text, last_name text );
CREATE TABLE
postgres=# insert into test_table (id,first_name,last_name) values (1,'John','Doe');
INSERT 0 1
postgres=# select * from test_table;
id | first_name | last_name
----+------------+-----------
1 | John | Doe
(1 row)
postgres=# 那么我的连接字符串在我的主目录中。
$ cat .pgpass
localhost:5432:testdb:dbuser1:StrongPassword我可以从提示符中连接:
developer@1604:~$ psql -d testdb -h localhost -U dbuser1
psql (11.7 (Ubuntu 11.7-2.pgdg18.04+1), server 9.5.14)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.
testdb=> https://unix.stackexchange.com/questions/574269
复制相似问题