Ubuntu 18.04 under PostgreSQL 10 installation and basic configuration

Source: Internet
Author: User
Tags postgresql


Download installation


Execute the following statement at the command line:

This command will help you to download the following PostgreSQL components:
`|`
-- | --
postgresql-client-10 | Client libraries and client binaries
postgresql-10 | Core Database Server
postgresql-contrib-9.x | Additional supplied modules (part of the POSTGRESQL-XX package in version and later)
Libpq-dev | Libraries and headers for C language frontend development
postgresql-server-dev-10 | Libraries and headers for C language backend development
Pgadmin4 | Pgadmin 4 Graphical Administration utility


User Configuration


Login to PostgreSQL via the following command:


sudo -u postgres psql


Enter the PostgreSQL command line view (you can see thepostgres=#prompt at the beginning), and then execute the following command to modify the Postgres user's password to "password":


ALTER USER postgres WITH PASSWORD ‘password‘;


Executes the\qcommand to eject the PostgreSQL command line.



You can set the password for the Postgre user in the command line interface with Superuser privileges:
Clear Password First:


sudo passwd -d postgres


In the Set password:


sudo -u postgre passwd


Follow the prompts and enter your new password two times.


Remote Login Configuration


Execute the following command:




Will


#listen_addresses = ‘localhost‘


Switch


listen_addresses = ‘*‘


(The comment was canceled, and the local access permission was changed to remote access)



Will


password_encryption = md5


Uncomment (the password will be transferred in encrypted mode, this step should not be required)



Restart Service:


sudo /etc/init.d/postgresql restart


Firewall settings for 5432 ports are allowed (the default port for PostgreSQL is 5432):


sudo iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 5432 -j ACCEPT


Ubuntu 18.04 under PostgreSQL 10 installation and basic configuration


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.