psql连接数据库

psql连接数据库

指定用户连接数据库

psql -d '数据库名'-U '用户名'
psql -d lawa -U odoo

查看当前连接情况

lawa=# \c
You are now connected to database "lawa" as user "odoo".
lawa=# 

已经进入到psql的情况

\c '数据库' '用户名'
lawa=# \c lawa lawa
You are now connected to database "lawa" as user "lawa".
lawa=# \c
You are now connected to database "lawa" as user "lawa".
lawa=# 

你可能感兴趣的:(数据库,sql,postgresql)