用超级管理员更改每个用户的密码
ubuntuq@ubuntuq-HP-Compaq-6910p-RH241AV:~$ su postgres
密码: admin123$
postgres@ubuntuq-HP-Compaq-6910p-RH241AV:/home/ubuntuq$ psql
psql (9.3.11)
Type "help" for help.
postgres=
postgres=
ALTER ROLE
postgres=
postgres@ubuntuq-HP-Compaq-6910p-RH241AV:/home/ubuntuq$ exit
exit
进入指定用户的制定数据库的快捷键
ubuntuq@ubuntuq-HP-Compaq-6910p-RH241AV:~$ psql -U geeklee -d exampledb -h 127.0.0.1 -p 5432
Password for user geeklee:
psql (9.3.11)
SSL connection (cipher: DHE-RSA-AES256-GCM-SHA384, bits: 256)
Type "help" for help.
exampledb=
ubuntuq@ubuntuq-HP-Compaq-6910p-RH241AV:~$ psql -U deploy -d pol2014 -h 127.0.0.1 -p 5432
Password for user deploy:
psql (9.3.11)
SSL connection (cipher: DHE-RSA-AES256-GCM-SHA384, bits: 256)
Type "help" for help.
pol2014=> \q
#
删除数据库
ubuntuq@ubuntuq-HP-Compaq-6910p-RH241AV:~$ su postgres
密码:
postgres@ubuntuq-HP-Compaq-6910p-RH241AV:/home/ubuntuq$ psql
psql (9.3.11)
Type "help" for help.
postgres=
postgres=
DROP DATABASE
postgres=
用超级管理员创建一个数据库给予每个用户
ubuntuq@ubuntuq-HP-Compaq-6910p-RH241AV:~$ su postgres
密码:
postgres@ubuntuq-HP-Compaq-6910p-RH241AV:/home/ubuntuq$ psql
psql (9.3.11)
Type "help" for help.
postgres=
CREATE DATABASE
postgres=
进入主数据库
psql postgres