![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PG
会写bug的程序猿
东南大学,六年开发经验,python,c,sql,shell
展开
-
postgresql数据库创建用户、密码设置、远程登录
1. 设置密码su - postgres psql # 登进去(默认没有密码)postgres=# \password postgres #执行sql语句,修改密码,postgres为用户名,其他用户修改也是如此Enter new password:Enter it again:2.创建用户及数据库postgres=# CREATE USER testuser WITH PASSWORD 'testuser';CREATE ROLEpostgres=# CREATE原创 2020-09-01 15:50:26 · 6741 阅读 · 0 评论 -
linux下postgresql远程登录
1.更改pg_hba.conf,配置用户的访问权限vim pg_hba.conf# TYPE DATABASE USER CIDR-ADDRESS METHOD# "local" is for Unix domain socket connections onlylocal all all trust# IPv4 local connections:host all all 127.0.0.1/32 trusthos原创 2020-09-01 15:35:52 · 1716 阅读 · 1 评论 -
postgreSQL服务重启
1. 查看postgresql进程:ps -ef|grep postgres2. 查看psotgresql端口:netstat -npl | grep postgres3.启停服务su - postgres pg_ctl start #启动pg_ctl stop #停止pg_ctl restart #重启4.返回第一步骤,通过查看进程是否存在来判断启停状态。注意:如果命令不存在,请先配置环境变量或找到数据库bin目录./pg_ctl执行...原创 2020-09-01 15:29:22 · 24307 阅读 · 0 评论