root@localhost ~]#su
bash-4.2$ su Password: su: Authentication failure //这里切换的是系统用户,现在还不清楚为什么postgres成了我的系统用户 bash-4.2$ su Password: [root@localhost ~]#
//qie huan yong hu:
[root@localhost data]# psql -h 127.0.0.1 -U postgres -d postgres Password for user postgres: psql (9.5.6) Type "help" for help. postgres=#
psql -h 127.0.0.1 -U postgres(yonghu) -d test1(shujuku)
[root@localhost data]# psql -h 127.0.0.1 -U postgres -d test1 Password for user postgres: psql (9.5.6) Type "help" for help. test1=# q