Web Hosting Talk







View Full Version : PostgreSQL admin password ??


adhytia
05-27-2001, 01:44 AM
We can not connect to pgsql admin password.....

For MySQL the admin password is cobalt-mysql...and already run as well....

But for pgsql, what is the admin password ..???
I've been lokking forward at www.cobalt.com and can not find any information about this problem...

Best Regards
Adhytia WS

Chicken
05-27-2001, 02:14 AM
Whoa - long signature! Is that four lines? :D

I tired to understand Postgres as well and ended up installig mysql on the machine. If it was in the manual, I missed it.

iplexx
05-27-2001, 05:08 AM
The cobalt knowledge base features an article on how to set a useable admin password to use postgres database engine:


"How can I accesss the Postgres database server on the RaQ3 to add databases, create tables, and add users?"



These instructions refer to the RaQ3 ONLY!
Do not attempt to use these instructions with other products

QuestionNum: 823
Product: RaQ3
Category Software
Creation Date: Thu May 25 09:32:55 2000 PDT

Question
How can I accesss the Postgres database server on the RaQ3 to add databases, create tables, and add users?


Response
NOTE: UNSUPPORTED. Cobalt Networks currently does not offer support for third party software or modified systems. Please contact the appropriate software vendor for further assistance. Modifications through root shell access could potentially void your warranty. A fee will be assessed by Cobalt for fixes or rebuilds on systems with unsupported modifications.

The following process will give the postgres user called "admin" the super-user privilage. Once this is done, a user can log into postgres using the admin account and modify itself to allow creation of users and databases.

1. telnet in as admin

2. use su - to switch to root

[admin@raq3 admin]$ su -
Password:
*****************************************************************

NOTICE TO ROOT USER: Changes to system files may affect
your warranty. Please consult your warranty card for details.

http://www.cobaltnet.com

*****************************************************************
[root@raq3 /root]#

3. use an editor and open the file /home/pgsql/pg_hba.conf

[root@raq3 /root]# vi /home/pgsql/pg_hba.conf

4. Change local all crypt to local all trust

5. use su to switch to the user ID postgres

[root@raq3 /root]# su postgres
[postgres@raq3 /root]$


6. Now run the psql program to connect to the database server.

[postgres@raq3 /root]$ psql cobalt
Welcome to the POSTGRESQL interactive sql monitor:
Please read the file COPYRIGHT for copyright terms of POSTGRESQL
[PostgreSQL 6.5.2 on i686-pc-linux-gnu, compiled by gcc egcs-2.91.66]

type ? for help on slash commands
type q to quit
type g or terminate with semicolon to execute query
You are currently connected to the database: cobalt

cobalt=>

7. Enter the following commands to give super-user privilage to admin and quit.

cobalt=> update pg_shadow set usesuper='t' where usename='admin';
UPDATE 1
cobalt=> q
[postgres@raq3 /root]$

8. Use the exit command to become "root" again.

9. Now open the /home/pgsql/pg_hba.conf file and change "local all trust" back to "local all crypt".

It is now possible to access postgres using the postgres account "admin". The password for this account is stored in the file /etc/cobalt/.meta.id and should not be changed. If the password needs to be changed, it must be changed in the pg_shadow table and the /etc/cobalt/.meta.id file. Be sure to maintain file permissions on the file or system security could be compromised.