Install and configure PostgreSQL 10.04 in Ubuntu 8.4

Source: Internet
Author: User
Tags psql

Installation environment: Ubuntu 10.04-desktop-i386 and PostgreSQL 8.4

Installation steps:

1. Install PostgreSQL

Enter the following command

Sudo apt-get install postgresql

The system prompts you to install the required disk space. Enter "y". The installation program is automatically completed. After the installation is complete, the system will create a database superuser "postgres" with a blank password. This user is both an Unlogged operating system user and a database user.

2. Modify the Linux User's postgres Password

Enter the following command

Sudo passwd ipvs

3. Modify the password of database superuser S

1) switch to postgres user in Linux

Sudo su postgres

2) log on to the ipvs Database

Psql postgres

In this way, you will see the following prompt message for S:

Psql (8.4.4)

Type "help" for help.

The command line prompt symbol of ipvs is displayed:

Postgres = #

3) enter the following command:

Alter user Login s with PASSWORD 'Password'

Type "\ q" to return to the Linux Command Line.

4. Add Custom Users and databases

1) Add a new user

Create user-drSP FedoraAdmin

Enter the password of the user as prompted.

2) create a database belonging to the Custom User fedoraAdmin

Create db-O fedodraAdmin mydb

With the above settings, you can use the following configuration in Java to connect to the PostgreSQL database:

User: fedoraAdmin

Password: your password

Url: jdbc: postgresql: // localhost: 5432/mydb

5. Install pgAdmin3

1) run the following command to install pgAdmin3:

Sudo apt-get install pgadmin3

2) type the following command to run pgAdmin3.

Pgadmin3

You will see the main interface of pgAdmin3 as follows:

Add parameters to create a connection to PostgreSql:

6. Set access to ipvs on other machines

Modify/etc/postgresql/8.4/main/pg_assist.conf:

Host all 0.0.0.0/0 md5 #0.0.0.0 is the address segment, and 0 is the binary bit

For example, 192.168.0.0/16 represents 192.168.0.1-192.168.255.254

Modify/etc/postgresql/8.4/main/postgresql. conf

Listen_address = '*'

Restart Database

Sudo/etc/init. d/postgresql-8.4 restart

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.