- 修改linux系统postgres用户的密码
第一:删除用户postgres的密码
sudo passwd -d postgres
第二:设置postgres用户的密码
sudo -u postgres passwd
系统提示输入新的密码
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
- 修改PostgreSQL数据库默认用户postgres的密码
第一: 登录psql
sudo -u postgres psql
第二:修改postgreSQL的密码
ALTER USER postgres WITH PASSWORD ‘postgres’;
密码处需要添加引号,最后结尾封号
改完后最好检查 data1/pg_hua.conf,关掉用户,或者修改密码。
最后systemctl stop postgresql-11.service
systemctl status postgresql-11.service
systemctl start postgresql-11.service