{"id":44385,"date":"2025-06-18T17:17:43","date_gmt":"2025-06-18T09:17:43","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/44385.html"},"modified":"2025-06-18T17:17:43","modified_gmt":"2025-06-18T09:17:43","slug":"pgadmin-4-%e8%bf%9e%e6%8e%a5-postgresql","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/44385.html","title":{"rendered":"pgAdmin 4 \u8fde\u63a5 postgreSQL"},"content":{"rendered":"<p>\u73af\u5883\u5982\u4e0b&#xff1a;<\/p>\n<ul>\n<li>\u5bbf\u4e3b\u673a\u4e3aWindows 11<\/li>\n<li>postgreSQL\u5b89\u88c5\u5728\u5bbf\u4e3b\u673a\u4e0a\u7684Linux\u865a\u673a\u4e2d&#xff0c;Hypervisor\u662fVirtualBox<\/li>\n<li>pgAdmin 4 \u5df2\u5b89\u88c5\u5728\u5bbf\u4e3b\u673a\u4e0a<\/li>\n<\/ul>\n<p>\u672c\u6587\u8bb2\u8ff0&#xff1a;\u5982\u4f55\u901a\u8fc7\u5bbf\u4e3b\u673a\u4e0a\u7684pgAdmin \u8fde\u63a5\u5230\u865a\u62df\u673a\u4e2d\u7684PG\u3002<\/p>\n<h3>\u8bbe\u7f6e\u76d1\u542c<\/h3>\n<p>\u9ed8\u8ba4\u7684PG\u76d1\u542c\u4e3b\u673a\u4e3alocalhost&#xff0c;\u5916\u90e8\u65e0\u6cd5\u8fde\u63a5\u3002<\/p>\n<p>postgres<span class=\"token operator\">&#061;<\/span><span class=\"token comment\"># show listen_addresses;<\/span><br \/>\n listen_addresses<br \/>\n<span class=\"token comment\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/span><br \/>\n localhost<br \/>\n<span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span> <span class=\"token keyword\">row<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>\u56e0\u6b64\u7b2c\u4e00\u6b65\u9700\u8981\u4fee\u6539\u76d1\u542c\u3002\u6b64\u8bbe\u7f6e\u5728\u6587\u4ef6$PGDATA\/postgresql.conf\u4e2d&#xff1a;<\/p>\n<p>listen_addresses &#061; &#039;*&#039;          # what IP address(es) to listen on;<br \/>\n#listen_addresses &#061; &#039;localhost&#039;         # what IP address(es) to listen on;<br \/>\n                                        # comma-separated list of addresses;<br \/>\n                                        # defaults to &#039;localhost&#039;; use &#039;*&#039; for all<br \/>\n                                        # (change requires restart)<\/p>\n<p>\u5982\u4f55\u4fee\u6539&#xff0c;\u5df2\u7ecf\u9700\u8981\u91cd\u542f&#xff0c;\u5728\u6ce8\u91ca\u4e2d\u5df2\u7ecf\u8bf4\u7684\u5f88\u6e05\u695a\u3002<\/p>\n<p>\u91cd\u542fPG&#xff1a;<\/p>\n<p>$ pg_ctl restart<\/p>\n<p>\u786e\u8ba4&#xff1a;<\/p>\n<p>postgres<span class=\"token operator\">&#061;<\/span><span class=\"token comment\"># show listen_addresses;<\/span><br \/>\n listen_addresses<br \/>\n<span class=\"token comment\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/span><br \/>\n <span class=\"token operator\">*<\/span><br \/>\n<span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span> <span class=\"token keyword\">row<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>OS\u5c42\u9762\u786e\u8ba4&#xff1a;<\/p>\n<p>$ <span class=\"token function\">netstat<\/span> -an<span class=\"token operator\">|<\/span><span class=\"token function\">grep<\/span> <span class=\"token number\">5432<\/span><br \/>\ntcp        <span class=\"token number\">0<\/span>      <span class=\"token number\">0<\/span> <span class=\"token number\">0.0<\/span>.0.0:5432            <span class=\"token number\">0.0<\/span>.0.0:*               LISTEN<br \/>\n<span class=\"token punctuation\">..<\/span>.<\/p>\n<p>netstat\u547d\u4ee4\u7684\u5b89\u88c5&#xff08;\u82e5\u4e0d\u5b58\u5728&#xff09;&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u67e5\u8be2netstat\u6240\u5728\u7684\u5305<\/span><br \/>\nyum whatprovides *\/netstat<br \/>\nyum <span class=\"token function\">install<\/span> net-tools<\/p>\n<h3>\u8bbe\u7f6e\u7aef\u53e3\u8f6c\u53d1<\/h3>\n<p>\u5c31\u662f\u6620\u5c04\u5bbf\u4e3b\u673a\u7684\u7aef\u53e35432\u5230\u865a\u62df\u673a\u4e2dPG\u7684\u76d1\u542c\u7aef\u53e35432\u3002<\/p>\n<p>\u53ef\u4ee5\u6bcf\u6b21\u5728VirtualBox\u4e2d\u6539&#xff0c;\u4e0d\u8fc7\u5efa\u8bae\u5728Vagrantfile\u4e2d\u6c38\u4e45\u4fee\u6539\u3002\u5728Vagrantfile\u4e2d\u6dfb\u52a0\u4ee5\u4e0b&#xff0c;\u7136\u540e\u91cd\u542f\u865a\u673a&#xff1a;<\/p>\n<p>config.vm.network <span class=\"token string\">&#034;forwarded_port&#034;<\/span>, guest: <span class=\"token number\">5432<\/span>, host: <span class=\"token number\">5432<\/span><\/p>\n<p>\u5728VirtualBox\u4e2d\u786e\u8ba4&#xff1a; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250618091741-685284350dd3f.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h3>\u8bbe\u7f6eHBA<\/h3>\n<p>\u4fee\u6539pg_hba.conf\u5982\u4e0b&#xff0c;\u5173\u952e\u662f\u6700\u540e\u4e00\u884c&#xff1a;<\/p>\n<p>$ cat pg_hba.conf<br \/>\n&#8230;<br \/>\nlocal   all             postgres                                peer<br \/>\nlocal all               &#043;athlethes,xiaoyu                       md5<br \/>\nhost    all             postgres,lewis  0.0.0.0\/0       md5<br \/>\n&#8230;<\/p>\n<p>$ pg_ctl reload<\/p>\n<p>\u5b9e\u9645\u4e0a\u4ece\u865a\u673a\u7684\u767b\u5f55\u4fe1\u606f&#xff0c;\u53ef\u4ee5\u5f97\u77e5\u5bbf\u4e3b\u673a\u7684\u5730\u5740\u4e3a10.0.2.2&#xff0c;\u56e0\u6b640.0.0.0\/0\u4e5f\u53ef\u4ee5\u6539\u4e3a10.0.2.2\u3002<\/p>\n<p>Using username <span class=\"token string\">&#034;vagrant&#034;<\/span><span class=\"token builtin class-name\">.<\/span><br \/>\nAuthenticating with public key <span class=\"token string\">&#034;vagrant&#034;<\/span><\/p>\n<p>Welcome to Oracle Linux Server release <span class=\"token number\">9.5<\/span> <span class=\"token punctuation\">(<\/span>GNU\/Linux <span class=\"token number\">5.15<\/span>.0-206.153.7.el8uek.x8                                                                             6_64<span class=\"token punctuation\">)<\/span><\/p>\n<p>The Oracle Linux End-User License Agreement can be viewed here:<\/p>\n<p>  * \/usr\/share\/eula\/eula.en_US<\/p>\n<p>For additional packages, updates, documentation and community help, see:<\/p>\n<p>  * https:\/\/yum.oracle.com\/<\/p>\n<p>Last login: Tue Jun <span class=\"token number\">17<\/span> 01:37:21 <span class=\"token number\">2025<\/span> from <span class=\"token number\">10.0<\/span>.2.2<\/p>\n<h3>pgAdmin\u7684\u8bbe\u7f6e<\/h3>\n<p>\u4ee5\u4e0b\u662f\u8fde\u63a5\u6210\u529f\u7684\u754c\u9762&#xff1a; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250618091741-685284353a070.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> General\u8bbe\u7f6e&#xff1a; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250618091741-68528435b311b.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>Connection\u8bbe\u7f6e&#xff1a; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250618091741-68528435f1825.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>Parameters\u8bbe\u7f6e&#xff1a; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250618091742-6852843640445.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u6ce8\u610f&#xff0c;\u5982\u679c\u7528postgres\u8fde\u63a5&#xff0c;\u6211\u662f\u4e0d\u77e5\u9053\u5176\u53e3\u4ee4\u7684&#xff0c;\u56e0\u6b64\u6211\u5728PG\u4e2d\u9884\u5148\u4fee\u6539\u4e86\u53e3\u4ee4&#xff1a;<\/p>\n<p><span class=\"token keyword\">ALTER<\/span> <span class=\"token keyword\">USER<\/span> postgres <span class=\"token keyword\">WITH<\/span> PASSWORD <span class=\"token string\">&#039;new_password&#039;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb167\u6b21\uff0c\u70b9\u8d5e3\u6b21\uff0c\u6536\u85cf6\u6b21\u3002\u672c\u6587\u8bb2\u8ff0\uff1a\u5982\u4f55\u901a\u8fc7\u5bbf\u4e3b\u673a\u4e0a\u7684pgAdmin \u8fde\u63a5\u5230\u865a\u62df\u673a\u4e2d\u7684PG\u3002<\/p>\n","protected":false},"author":2,"featured_media":44380,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[4142,4144,4143,954,4141],"topic":[],"class_list":["post-44385","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-database","tag-hba","tag-pgadmin","tag-postgresql","tag-postgressql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>pgAdmin 4 \u8fde\u63a5 postgreSQL - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/44385.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"pgAdmin 4 \u8fde\u63a5 postgreSQL - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb167\u6b21\uff0c\u70b9\u8d5e3\u6b21\uff0c\u6536\u85cf6\u6b21\u3002\u672c\u6587\u8bb2\u8ff0\uff1a\u5982\u4f55\u901a\u8fc7\u5bbf\u4e3b\u673a\u4e0a\u7684pgAdmin \u8fde\u63a5\u5230\u865a\u62df\u673a\u4e2d\u7684PG\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/44385.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-18T09:17:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250618091741-685284350dd3f.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/44385.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/44385.html\",\"name\":\"pgAdmin 4 \u8fde\u63a5 postgreSQL - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-06-18T09:17:43+00:00\",\"dateModified\":\"2025-06-18T09:17:43+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/44385.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/44385.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/44385.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"pgAdmin 4 \u8fde\u63a5 postgreSQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"pgAdmin 4 \u8fde\u63a5 postgreSQL - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/44385.html","og_locale":"zh_CN","og_type":"article","og_title":"pgAdmin 4 \u8fde\u63a5 postgreSQL - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb167\u6b21\uff0c\u70b9\u8d5e3\u6b21\uff0c\u6536\u85cf6\u6b21\u3002\u672c\u6587\u8bb2\u8ff0\uff1a\u5982\u4f55\u901a\u8fc7\u5bbf\u4e3b\u673a\u4e0a\u7684pgAdmin \u8fde\u63a5\u5230\u865a\u62df\u673a\u4e2d\u7684PG\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/44385.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-06-18T09:17:43+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/06\/20250618091741-685284350dd3f.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/44385.html","url":"https:\/\/www.wsisp.com\/helps\/44385.html","name":"pgAdmin 4 \u8fde\u63a5 postgreSQL - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-06-18T09:17:43+00:00","dateModified":"2025-06-18T09:17:43+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/44385.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/44385.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/44385.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"pgAdmin 4 \u8fde\u63a5 postgreSQL"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/44385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=44385"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/44385\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/44380"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=44385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=44385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=44385"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=44385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}