Postgres allows other Linux users to log on through the command line:
1. Modify the file pg_mirror.conf in the/usr/local/pgsql/data directory.
Local all ident Omicron
2. Modify the file pg_ident.conf in the/usr/local/pgsql/data directory to add
Omicron root ipvs
3. Restart ipvs
Run/etc/init. d/PostgreSQL restart
4. Use the following command to access the database:
/Usr/local/pgsql/bin/Psql mydb-u Postgres
Here we use the absolute path of Psql. If you have used the system to automatically install Psql, you can directly use Psql. This depends on your system situation. The same is true for the path in step 1 and step 2.
Postgres does not allow logon to phpPgAdmin by default:
1. Modify the/var/lib/pgsql/data/pg_cmd.conf file as follows:
# IPv4 local connections
Host All all 127.0.0.1/32 MD5 // change to MD5 authentication
2. Modify/var/www/html/PHPPGAdmin/CONF/config. Inc. php
$ Conf ['extra _ login_security '] = false; // change to false.
3. Execute the following command to create a postgre user
# Su ipvs
$ Createuser Test
Enter the password twice ....
Are you sure you want to set this user to serperuser? Select Yes
User Created successfully.
$ Exit /// switch back to the root user
#/Etc/rc. d/init. d/PostgreSQL restart // restart the postgre Database
Log on to phpPgAdmin with the test user and password again.
Modify database server password:
Run Psql Postgres as the Postgres user
Run:
Alter User Login s with encrypted password 'yourpassword'
Effect:
Bytes -----------------------------------------------------------------------------------------------------------------
Welcome to Psql
8.2.6, the PostgreSQL interactive terminal.
Type:/copyright
Distribution terms
/H for help with SQL commands
/? For help with Psql
Commands
/G or terminate with semicolon to execute Query
/Q
Quit
Postgres = # alter user authentication s with encrypted
Password 'yourpassword ';
Alter role
Postgres = #
Bytes ------------------------------------------------------------------------------------------------------------------
The above content comes from the following addresses:
Http://hi.baidu.com/luna_kiss_moon/blog/item/f57ba70ec71c8eeb37d12226.html
Http://www.xxlinux.com/linux/article/development/database/20070919/9818.html
Http://www.hacms.com/html/2010/0308/34551.html