zhenxun_bot/assets/js/c459bd47.f8280a59.js

1 line
6.6 KiB
JavaScript
Raw Normal View History

"use strict";(self.webpackChunkzhenxun_docs=self.webpackChunkzhenxun_docs||[]).push([[5917],{149:(n,s,e)=>{e.r(s),e.d(s,{assets:()=>d,contentTitle:()=>t,default:()=>h,frontMatter:()=>r,metadata:()=>c,toc:()=>o});var l=e(4848),i=e(8453);const r={title:"Linux",sidebar_position:1},t="Linux\u4e0b\u5b89\u88c5",c={id:"install/install-sql/postgresql/linux",title:"Linux",description:"1.\u5b89\u88c5",source:"@site/docs/install/install-sql/postgresql/linux.md",sourceDirName:"install/install-sql/postgresql",slug:"/install/install-sql/postgresql/linux",permalink:"/zhenxun_bot/install/install-sql/postgresql/linux",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/install/install-sql/postgresql/linux.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{title:"Linux",sidebar_position:1},sidebar:"installSidebar",previous:{title:"Sqlite",permalink:"/zhenxun_bot/install/install-sql/sqlite"},next:{title:"Windows",permalink:"/zhenxun_bot/install/install-sql/postgresql/windows"}},d={},o=[{value:"1.\u5b89\u88c5",id:"1\u5b89\u88c5",level:2},{value:"2.\u914d\u7f6e\u5916\u7f51\u8fde\u63a5\uff08\u53ef\u7701\u7565\uff09",id:"2\u914d\u7f6e\u5916\u7f51\u8fde\u63a5\u53ef\u7701\u7565",level:2}];function a(n){const s={admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...n.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.header,{children:(0,l.jsx)(s.h1,{id:"linux\u4e0b\u5b89\u88c5",children:"Linux\u4e0b\u5b89\u88c5"})}),"\n",(0,l.jsx)(s.h2,{id:"1\u5b89\u88c5",children:"1.\u5b89\u88c5"}),"\n",(0,l.jsx)(s.p,{children:"1.\u76f4\u63a5\u547d\u4ee4\u884c\u8f93\u5165"}),"\n",(0,l.jsx)(s.pre,{children:(0,l.jsx)(s.code,{className:"language-bash",children:"sudo apt update\nsudo apt install postgresql postgresql-contrib\n"})}),"\n",(0,l.jsxs)(s.ol,{children:["\n",(0,l.jsx)(s.li,{children:"\u521b\u5efa\u6570\u636e\u5e93\u548c\u7528\u6237\uff08\u4f9d\u6b21\u8f93\u5165\uff09"}),"\n"]}),"\n",(0,l.jsxs)(s.ul,{children:["\n",(0,l.jsx)(s.li,{children:"\u5207\u6362\u7528\u6237"}),"\n"]}),"\n",(0,l.jsx)(s.pre,{children:(0,l.jsx)(s.code,{className:"language-bash",children:"sudo su - postgres\n"})}),"\n",(0,l.jsxs)(s.ul,{children:["\n",(0,l.jsx)(s.li,{children:"\u8fdb\u5165psql"}),"\n"]}),"\n",(0,l.jsx)(s.pre,{children:(0,l.jsx)(s.code,{className:"language-bash",children:"psql\n"})}),"\n",(0,l.jsxs)(s.ul,{children:["\n",(0,l.jsx)(s.li,{children:"\u521b\u5efa\u7528\u6237\uff08\u6b64\u6b65\u9aa4\u53ef\u8df3\u8fc7\uff09"}),"\n"]}),"\n",(0,l.jsx)(s.pre,{children:(0,l.jsx)(s.code,{className:"language-bash",children:" # \u7528\u6237\u540d\u2193 # \u5bc6\u7801\u2193\nCREATE USER uname WITH PASSWORD 'zhenxun';\n"})}),"\n",(0,l.jsxs)(s.ul,{children:["\n",(0,l.jsx)(s.li,{children:"\u66f4\u6539\u5bc6\u7801"}),"\n"]}),"\n",(0,l.jsx)(s.pre,{children:(0,l.jsx)(s.code,{className:"language-bash",children:" # \u5bc6\u7801\u2193\nalter user postgres with password 'zhenxun_bot'; \n"})}),"\n",(0,l.jsxs)(s.ul,{children:["\n",(0,l.jsx)(s.li,{children:"\u521b\u5efa\u6570\u636e\u5e93"}),"\n"]}),"\n",(0,l.jsx)(s.pre,{children:(0,l.jsx)(s.code,{className:"language-bash",children:" # \u6570\u636e\u5e93\u540d\u79f0\u2193 \u6240\u6709\u8005(\u7528\u6237\u540d)\u2193\nCREATE DATABASE zhenxun_bot OWNER postgres; \n"})}),"\n",(0,l.jsx)(s.admonition,{type:"tip",children:(0,l.jsx)(s.p,{children:"\u5230\u8fd9\u4e00\u6b65\u6570\u636e\u5e93\u5df2\u7ecf\u53ef\u4ee5\u6b63\u5e38\u4f7f\u7528\u4e86\uff01\u4ee5\u4e0b\u6b65\u9aa4\u4e3b\u8981\u7528\u4e8e\u5916\u7f51\u53ef\u4ee5\u8fde\u63a5\u5165\u670d\u52a1\u5668\u6570\u636e\u5e93\uff0c\u53ef\u4ee5\u7b49\u9700\u8981\u7684\u65f6\u5019\u518d\u914d\u7f6e\u3002"})}),"\n",(0,l.jsx)(s.admonition,{type:"tip",children:(0,l.jsxs)(s.p,{children:["\u2728\u2728 \u6210\u529f\u5b8c\u6210\u4e86",(0,l.jsx)(s.code,{children:"Postgresql"}),"\u7684\u6570\u636e\u5e93\u914d\u7f6e\uff0c\u9a6c\u4e0a\u8981\u5