标签: postgresql

没有密码的 SSH 不适用于用户 postgres

我尝试手动将公钥添加到authorized_keys 和authorized_keys2。我还仔细检查了 .ssh (700) 和 authorized_keys (644) 的权限。我可以使用另一个用户(服务器用户)在同一台机器上无需密码登录。

这是 ssh -vvv 的输出:

ssh postgres@java7 -vvv
OpenSSH_4.3p2, OpenSSL 0.9.8b 04 May 2006
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to java7 [192.168.120.28] port 22.
debug1: Connection established.
debug1: identity file /home/informix/.ssh/identity type -1
debug3: Not a RSA1 key file /home/informix/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace …
Run Code Online (Sandbox Code Playgroud)

ssh postgresql authorized-keys

5
推荐指数
1
解决办法
4968
查看次数

在整个 postgres 数据库中搜索字符串

在 phpmyadmin 中,我可以使用搜索选项卡轻松搜索数据库表中的文本。想知道我是否可以对本地安装在我的计算机上的 postgres 做同样的事情。我看过那里的菜单,但我找不到类似的东西。有谁知道如何在整个数据库中搜索我输入的文本?

postgresql pgadmin

5
推荐指数
1
解决办法
1万
查看次数

在没有 apt-get 的情况下安装 postgres

我可以访问科学 HPC 上的机器,并且我正在设置一个环境来创建一个 Web 应用程序,该应用程序基本上由TOMCATpostgresql 组成。我无法使用其他 Web 服务器。

操作系统是带有 Debian (squeeze) 的 linux,我没有对机器的root访问权限。

在谷歌搜索了一下之后,我只找到了需要对机器进行 root 访问才能安装 postgresql (apt-get ....) 的方法。

是否可以在我拥有完全权限的本地目录中安装 postgresql?或者 postgresql 是否一定需要安装 root 访问权限?为什么?

linux debian root postgresql

5
推荐指数
2
解决办法
4152
查看次数

如何使用 APT 安装旧版本的 Postgres?

我正在使用 Kubuntu 16.04LTS。我想安装 Postgres 9.3(当前版本是 9.5,这是主存储库中的版本)。

9.3 版的 .deb 文件可在http://packages.ubuntu.com/trusty/postgresql-9.3 获得,但如果可能的话,我想通过 APT。我试过了

$ sudo apt-get install postgresql=9.3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Version '9.3' for 'postgresql' was not found
Run Code Online (Sandbox Code Playgroud)

(与postgresql=9.3.11-0ubuntu0.14.04)和

$ sudo apt-get -t=14.04 install postgresql
Reading package lists... Done
E: The value '14.04' is invalid for APT::Default-Release as such a release is not available in the sources
Run Code Online (Sandbox Code Playgroud)

(因为 9.3 是 14.04 存储库中的最新版本)。

我已经查找了有关这些错误消息的信息,但找不到任何有用的信息。如何使用 APT 安装旧版本的 Postgres?

postgresql ubuntu apt

5
推荐指数
1
解决办法
1万
查看次数

由于依赖关系,在 EC2 上的 Amazon Linux 2 上为 postgres 9.6 rpm 安装 yum 失败

由于依赖 /etc/redhat-release,在 EC2 上的 Amazon Linux 2 上为 postgres 9.6 rpm 安装 yum 失败

下面是日志

sudo yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm

Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
pgdg-centos96-9.6-3.noarch.rpm                                                                                                                 | 5.6 kB  00:00:00     

Examining /var/tmp/yum-root-BrRLfO/pgdg-centos96-9.6-3.noarch.rpm: pgdg-redhat-repo-42.0-4.noarch

Marking /var/tmp/yum-root-BrRLfO/pgdg-centos96-9.6-3.noarch.rpm to be installed

Resolving Dependencies
--> Running transaction check
---> Package pgdg-redhat-repo.noarch 0:42.0-4 will be installed
--> Processing Dependency: /etc/redhat-release for package: pgdg-redhat-repo-42.0-4.noarch amzn2-core                                                                                                                                     | 2.4 kB  00:00:00     
--> Processing Dependency: /etc/redhat-release for package: pgdg-redhat-repo-42.0-4.noarch
--> Finished Dependency Resolution

Error: Package: pgdg-redhat-repo-42.0-4.noarch (/pgdg-centos96-9.6-3.noarch)
           Requires: /etc/redhat-release
Run Code Online (Sandbox Code Playgroud)

yum postgresql amazon-ec2 installation

5
推荐指数
1
解决办法
5800
查看次数

如何通过 PuTTY 在 Windows 7 的 Linux 上使用 UTF-8?

我在 Windows 7 上使用 PuTTY 访问装有 Ubuntu 10.10 的 Linux 机器。我认为 Windows 7 使用的是 Latin-1。但是我需要在 Linux 机器和 PostgreSQL 数据库中使用 UTF-8。

我怎样才能用 PuTTY 做到这一点?

windows-7 postgresql putty latin1 utf-8

4
推荐指数
1
解决办法
5627
查看次数

Homebrew postgres 在卸载、重新安装和重启后无法启动

我通过自制软件卸载并重新安装了 postgresql。它工作正常,直到我重新启动计算机。现在我正在尝试运行我的测试,但它们正在爆炸。我正在查看当前进程,但没有看到所有这些 postgres 实例正在运行。我想我必须打开postgres。我试过跑步

pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
Run Code Online (Sandbox Code Playgroud)

但这似乎没有任何作用(尽管它确实说server starting,这是错误的)

如何启动服务器?

更新。日志信息:

cat /usr/local/var/postgres/server.log 
postgres cannot access the server configuration file "/usr/local/var/postgres/postgresql.conf": No such file or directory
Run Code Online (Sandbox Code Playgroud)

谢谢

postgresql homebrew macos

4
推荐指数
1
解决办法
4248
查看次数

在 CMD 中从 windows 用户更改 postgreSQL 数据库用户

我最近在 Windows 7 上安装了 PostgreSQL,每次我尝试使用 CMD 执行 SQL 命令时,我都会收到此错误

createdb: could not connect to database template1: FATAL: password authentication failed for user "R-61"

其中 R-61 是我的 Windows 机器用户名。

这是我如何在 pgSQL 中使用 CMD

  • 首先我 cd 到 pgSQL bin 文件夹 $ cd C:\xampp\pgsql\9.1\bin
  • 我尝试创建一个数据库 $ createdb NEWDATABASE
  • 我收到输入密码的提示。这是我感到困惑的地方,因为我不知道密码是什么。我已经尝试过我的窗口用户密码、postgres超级用户密码,但似乎都不起作用。这是我收到的错误信息 createdb: could not connect to database template1: FATAL: password authentication failed for user "R-61"

    有人知道这个问题的解决方案吗?我想将用户表单 R-61 更改为postgres超级用户会起作用,但我不知道该怎么做。

非常需要您的帮助。

postgresql

4
推荐指数
1
解决办法
2万
查看次数

pg_ident.conf 工作吗?

当我尝试运行 psql 时,它说:

psql --version
psql (PostgreSQL) 9.3.12
psql
psql: FATAL:  Peer authentication failed for user "testuser"
Run Code Online (Sandbox Code Playgroud)

这是我的pg_hba.conf

# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer    map=testmap
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
Run Code Online (Sandbox Code Playgroud)

这是我的pg_ident.conf

# MAPNAME       SYSTEM-USERNAME         PG-USERNAME
testmap         testuser                postgres …
Run Code Online (Sandbox Code Playgroud)

linux postgresql

4
推荐指数
1
解决办法
5901
查看次数

postgresql 的 chroot 环境中的共享内存:权限被拒绝?

尝试设置运行 postgresql 9.5 的 chroot 环境(这是为了在使用相同配置的同时允许影子数据分区)。我收到以下错误:

 FATAL:  could not open shared memory segment "/PostgreSQL.1804289383": Permission denied
Run Code Online (Sandbox Code Playgroud)

这类似于chroot 环境中的共享内存。但是dev已经被绑定了,所以这显然不是正确的答案。

更多信息:RHEL7 systemd,linux 3.10。

linux postgresql

4
推荐指数
1
解决办法
3283
查看次数