ubuntu preview 设置密码

安装

sudo apt-get isntall postgresql

登录(无需密码)

sudo -u postgres psql 

修改密码

alter user postgres with password '123456';

新密码登录

 psql -U postgres -d postgres -h 127.0.0.1 -p 5432

允许远程(默认是只接受本地访问链接的)

vim /etc/postgresql/12/main/postgresql.conf
 listen_addresses = '*'
posted @ 2024-09-05 11:29  vx_guanchaoguo0  阅读(11)  评论(0)    收藏  举报