Ubuntu系统下psql终端命令 连接数据库
2024-05-17 17:20 古兆洋 阅读(15) 评论(0) 编辑 收藏 举报源自:https://blog.csdn.net/weixin_43632687/article/details/124966567
连接命令
1 psql -h ***** -p 5432 -U root -d postgres
其中,h表示地址,p表示端口号,u表示用户名,d表示数据库。
psql -h *****-p 5432-U root -d postgres
登录成功,查询语句一定要有;。例如:select * from user;
如果查询成功,想退出查询,输入:\q。