postgresql pgAdmin - 共享数据库连接定义

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3464396/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-20 00:15:06  来源:igfitidea点击:

pgAdmin - Sharing DB Connection Definitions

postgresqlpgadmin

提问by JHA

I have a few database servers and few developers.
I have set up database connection definitions on my PC for each servers and now I want to share with other developers but I was not sure how to export and import the definitions.

我有几个数据库服务器和几个开发人员。
我已经在我的 PC 上为每台服务器设置了数据库连接定义,现在我想与其他开发人员共享,但我不确定如何导出和导入定义。

I am running pgAdmin 1.10.2 on Ubuntu 10.04 (lucid).

我在 Ubuntu 10.04 (lucid) 上运行 pgAdmin 1.10.2。

回答by Guillaume Lelarge

You should have a .pgadmin3 conf file in your home directory. You just need to give that one to your fellow developers.

您的主目录中应该有一个 .pgadmin3 conf 文件。您只需要将其提供给您的开发人员同行即可。

回答by Kevin P.

By the way, for those looking for the answer to this question on the Windows platform, the server definitions are stored in the Windows registry at HKEY_CURRENT_USER\Software\pgAdmin III\Servers

顺便说一下,对于那些在 Windows 平台上寻找这个问题的答案的人,服务器定义存储在 Windows 注册表中的 HKEY_CURRENT_USER\Software\pgAdmin III\Servers

You can export this key to a .reg file and share it. However, due to the naming of the keys, it will likely overwrite any existing keys in the target registry.

您可以将此密钥导出到 .reg 文件并共享。但是,由于键的命名,它可能会覆盖目标注册表中的任何现有键。

回答by ojhurst

On Original Computer

在原装电脑上

Export the server definitions found in Windows registry found here:

导出在此处找到的 Windows 注册表中的服务器定义:

Windows Key > regedit

Windows 键 > regedit

HKEY_CURRENT_USER\Software\pgAdmin III\Servers

HKEY_CURRENT_USER\Software\pgAdmin III\Servers

Right Click on Servers Folder and click Export

右键单击服务器文件夹,然后单击导出

Leave the default radio button 'Selected Branch' the way it is. This will be how it knows where to insert it when you want to import it.

保留默认单选按钮“选定分支”的原样。当您想导入它时,这将是它知道在哪里插入它的方式。

Choose a name for your file (e.g. pgadminServers) and click Save

为您的文件选择一个名称(例如 pgadminServers)并单击保存

This is the file you will use to import to another computer (which ideally has the same version of pgAdmin)

这是您将用于导入到另一台计算机(理想情况下具有相同版本的 pgAdmin)的文件

On New Computer

在新电脑上

Make sure pgadmin is not currently open

确保 pgadmin 当前未打开

Windows Key > regedit

Windows 键 > regedit

File > Import > Choose your pgadminServers.reg file.

文件 > 导入 > 选择您的 pgadminServers.reg 文件。

Click Ok to the alert that says 'The keys and values contained in //filepath have been successfully added to the registry.'

单击“确定”以显示“//filepath 中包含的键和值已成功添加到注册表”的警报。

Close or exit the registry editor

关闭或退出注册表编辑器

Launch pgAdmin

启动 pgAdmin

回答by amacvar

Not enough reputation, else I would add a comment to @ojhurst

没有足够的声誉,否则我会向@ojhurst添加评论

IF you leave your pgAdmin III open or have already added a server and then import the pgadminServers.reg file

如果您将 pgAdmin III 保持打开状态或已经添加了服务器,然后导入 pgadminServers.reg 文件

Edit that file (or modify entry in registry) the following entry

编辑该文件(或修改注册表中的条目)以下条目

[HKEY_USERS\S-1-5-21-....-1140347\Software\pgAdmin III\Servers] "Count"=dword:0000001

[HKEY_USERS\S-1-5-21-....-1140347\Software\pgAdmin III\Servers] "Count"=dword:0000001

to the total count of servers (e.g. 53)

到服务器的总数(例如 53)

[HKEY_USERS\S-1-5-21-....-1140347\Software\pgAdmin III\Servers] "Count"=dword:0000053

[HKEY_USERS\S-1-5-21-....-1140347\Software\pgAdmin III\Servers] "Count"=dword:0000053

回答by quasoft

PgAdmin 4stores the server connection details in an SQLite3 file.

PgAdmin 4将服务器连接详细信息存储在 SQLite3 文件中。

In Windowsthis file is located at:

Windows 中,此文件位于:

%APPDATA%\pgAdmin\pgadmin4.db

In Linuxit lives at:

Linux 中,它位于:

/var/lib/pgadmin4/pgadmin4.db

You can configure a custom location by editing config_local.pyfile.

您可以通过编辑config_local.py文件来配置自定义位置 。