Ubuntu PostgreSQL Installation and configuration

Source: Internet
Author: User
Tags psql administrator password

First, installation

1, Installation: Use the following command, will automatically install the latest version, here is 9.5

sudo Install PostgreSQL

When the installation is complete, a default database account named "Postgres" with no password is created as the database administrator, and a Linux user named "Postgres" is created.

Some information after the installation is complete is as follows:

Config/etc/postgresql/9.5/main
Data/var/lib/postgresql/9.5/main
Locale en_US. UTF-8
Socket/var/run/postgresql
Port 5432

Second, modify the database default Administrator password 1, connect to the database

Execute the PSQL client as a Linux user "Postgres" and enter the client's prompt interface

sudo -u postgres psql

2. Modify the password of the default administrator for the database
' 123456 '

This way, the administrator "Postgres" The password is "123456".

Exit psql Client Command: \q

Third, modify the password of Linux user Postgres

This is actually not the same as installing PostgreSQL: Run the passwd command as a "Postgres" Linux User

[Email protected]:/etc/postgresql/9.5sudopasswd  for passwd: Password updated successfully
Iv. Configuring the database to run remote connection access

After the installation is complete, the database can only be connected locally, and the other machines will not be able to access it.

1. Modify the Listening address
sudo gedit/etc/postgresql/9.5

Remove the comment #listen_addresses = ' localhost ' and change it to listen_addresses = ' * '

2. Modify the IP segment of the accessible user
sudo gedit/etc/postgresql/9.5

At the end of the file, add: host all 0.0. 0.0 0.0. 0.0 MD5 , indicating that any IP connection is running

3. Restart the database
sudo /etc/init.d/postgresql restart

Other: Managing users, establishing databases, etc.

V. References

Http://blog.sina.com.cn/s/blog_6af33caa0100ypck.html

Ubuntu PostgreSQL Installation and 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.