Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Postgresql Learning-Part 1

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Error, allow local connection:

-bash-4.1$ psql mydb

Psql: FATAL: no pg_hba.conf entry for host "[local]", user "postgres", database "mydb", SSL off

Add the following to the configuration file: pg_hba.conf

# IPv4 local connections:

# allow local connections

Local all all trust

# allow remote connections

Host all all 0.0.0.0/0 md5

two。 Launch the psql command line

\ Q

Mydb-#\ Q

-bash-4.1 $

3. Similar to oracle sqlplus

Mydb=# select version ()

Version

-

PostgreSQL 8.4.20 on x86_64-redhat-linux-gnu, compiled by GCC gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17), 64-bit

(1 row)

Mydb=# select current_date

Date

-

2017-05-18

(1 row)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report