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