输入:sudo su - postgres

在bash下输入:psql,下文出现postgres字样

在postgres后:输入:\c 数据库名称,连接数据库

在数据库名#:输入查询语句或者其他sql语句

postgres 使用psql连接的更多相关文章

  1. MySQL and Postgres command equivalents (mysql vs psql)

    MySQL and Postgres command equivalents (mysql vs psql) 博客分类: Database   From: http://blog.endpoint.c ...

  2. PostgreSQL远程连接配置管理/账号密码分配(解决:致命错误: 用户 "postgres" Ident 认证失败)

    问题:致命错误: 用户 "postgres" Ident 认证失败 说明:这个是由于没有配置远程访问且认证方式没改造成的,只需要更改使用账号密码认证即可. 解决:找到pg_hba. ...

  3. ArcGIS连接Postgres 数据库

    ArcGIS连接Postgres 数据库 此前在使用ArcGIS的过程中,一般使用文件方式对数据进行管理,后面也有使用 GeoDatabase 数据库对数据进行管理,但是这种管理方式也存在一些弊端,特 ...

  4. centos6.4下面安装postgresql以及客户端远程连接

    一.安装 centos6.4服务器IP:192.168.220.131 window7客户端IP:192.168.199.218 在centos官网http://www.postgresql.org/ ...

  5. 配置recovery_min_apply_delay后重启standby节点报错:psql: FATAL: the database system is starting up

    环境: pg版本:PostgreSQL 9.4.4 on x86_64 系统版本:CentOS release 6.6 linux内核版本:2.6.32-504.8.1.el6.x86_64 今天测试 ...

  6. 连接postgresql数据库

    初装postgresql数据库会产生默认的数据库用户postgres和同名的数据库.但是我的linux用户是jm,两者不一致,连不上数据库.于是先把linux用户切换为postgres.(数据库会为l ...

  7. postgresql的psql常用命令-4

    psql是PostgreSQL的一个命令行交互式客户端工具 1. 查看postgresql账号 [root@localhost ~]#cat /etc/passwdroot:x:0:0:root:/r ...

  8. 用docker-compose部署postgres+ postgis

    20190411更新.之前写的太啰嗦,也不删了,重新来.小坑还是有的 psql 命令行客户端 因为postgres用docker镜像安装,所以host不需要安装pg,只需要安装客户端 sudo apt ...

  9. psql: could not connect to server: No such file or directory&&PGHOST

    由于环境变量 PGHOST配置不当引起的 postgres@pgdb-> psql psql: could not connect to server: No such file or dire ...

随机推荐

  1. js实现复制内容到剪贴板

    一. 原生js实现,电脑可以用,手机不可以用 1. 必须是 input元素 才可以使用 <input id="code" type="text" valu ...

  2. DockerFile 编译语法详解

    Dockerfile是一个文本格式的配置文件,用户可以使用Dockerfile来快速创建自定义的镜像,本小结首先介绍Dockerfile典型的基本结构和它支持的众多指令,并具体讲解通过这些指令来编写定 ...

  3. O004、启动第一个KVM虚机

    参考https://www.cnblogs.com/CloudMan6/p/5249270.html   本节演示如何使用 virt-manager 启动 KVM 虚机,   提前下载一个 cirro ...

  4. 封装H5ToApp方法

    方法一: 新建个 Android studio 项目,用 webview 指定访问你的页面 方法二: 使用工具 cordova  附上地址:http://cordova.axuer.com/docs/ ...

  5. Linux配置nginux

    安装依赖 yum install gcc yum install pcre-devel yum install zlib zlib-devel yum install openssl openssl- ...

  6. Exited too quickly (process log may have details)-配置问题

    在配置supervisor的时候,提示Exited too quickly (process log may have details),这个时候一脸懵逼,啥回事,执行太快了???

  7. HttpClient 释放连接

    Release the Connection:释放连接 This is a crucial step to keep things flowing. We must tell HttpClient t ...

  8. shell 删除文本中的重复行

    三种常见方法:第一,用sort+uniq,注意,单纯uniq是不行的. shell> sort -k2n file | uniq > a.out 这里我做了个简单的测试,当file中的重复 ...

  9. ldap搭建

    yum install openldap openldap-servers openldap-clients -y #检查是否安装成功 slapd -VVopenldap的配置文件都在/etc/ope ...

  10. 安全专家发现GE Multilin SR的一个关键漏洞对全球电网构成严重威胁。

    A team of researchers from New York University has found a serious vulnerability in some of GE Multi ...