1. 修改PostgreSQL数据库默认用户postgres的密码
[root@izwz90tx4egvh4qj3p95vsz ~]# sudo -u postgres psql
psql (10.4)
Type "help" for help.
postgres=# ALTER USER postgres WITH PASSWORD 'duyeweb';
ALTER ROLE
注意:
- 密码postgres要用引号引起来
- 命令最后有分号
2. 修改linux系统postgres用户的密码
步骤一:删除用户postgres的密码
[root@izwz90tx4egvh4qj3p95vsz ~]# sudo passwd -d postgres
Removing password for user postgres.
passwd: Success
步骤二:设置用户postgres的密码
[root@izwz90tx4egvh4qj3p95vsz ~]# sudo -u postgres passwd
Changing password for user postgres.
New password:
BAD PASSWORD: The password fails the dictionary check - it does not contain enough D