PostgreSQL Import and Export

Source: Internet
Author: User
Tags postgresql psql

Import command

psql-d game-u postgres-f/root/plubic.sql

The following error occurred:

Psql:FATAL:Peer authentication failed for user "Postgres" The workaround for this subcommand

Run the following command to edit the pg_hba.conf file because pg_hba.conf cannot be found

Find/-name pg_hba.conf

Vi/var/lib/pgsql/9.5/data/pg_hba.conf

2. The

# Database Administrative Login by Unix domain socketlocal   all             postgres                                peer

Switch

# Database Administrative Login by Unix domain socketlocal   all             postgres                                Trust



3. After saving, execute the following command to reload the configuration file:
/etc/init.d/postgresql-9.5 Reload

4. Log in to Postgres
Sudo-u Postgres Psql
\l Viewing a database
\c GAME
\d Viewing the game's table

PostgreSQL Import and Export

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.