Creating of User and Database

Поиск
Список
Период
Сортировка
Искать

Creating of User and Database

От:
"APSC, Patrick Chee Seng Onn" <APSC@bossard.com.sg>
Дата:
Hi,

  I've just installed postgresql onto my system but unable to successfully add new users and databases. I would receive a error message:

	createuser: could not connect to database template1: FATAL user "root" does not exist

	createdb: could not connect to database template1: FATAL user "root" does not exist

  what is the error I am facing anyway?

Patrick

Re: Creating of User and Database

От:
"chris smith" <dmagick@gmail.com>
Дата:
On 5/11/06, APSC, Patrick Chee Seng Onn  wrote:
> Hi,
>
>   I've just installed postgresql onto my system but unable to successfully add new users and databases. I would receive a error message:
>
>         createuser: could not connect to database template1: FATAL user "root" does not exist
>
>         createdb: could not connect to database template1: FATAL user "root" does not exist
>
>   what is the error I am facing anyway?

Either try:

createuser -U postgres new_username

or, su to postgres:

su - postgres

and try again:

createuser new_username


http://www.designmagick.com/article/5/Starting-Out/PostgreSQL-Users
http://www.designmagick.com/article/6/Starting-Out/PostgreSQL-Databases

-- 
Postgresql & php tutorials
http://www.designmagick.com/

Re: Creating of User and Database

От:
Martijn van Oosterhout <kleptog@svana.org>
Дата:
Вложения:
On Thu, May 11, 2006 at 10:35:12AM +0800, APSC, Patrick Chee Seng Onn wrote:
> Hi,
> 
>   I've just installed postgresql onto my system but unable to successfully add new users and databases. I would receive a error message:
> 
> 	createuser: could not connect to database template1: FATAL user "root" does not exist
> 
> 	createdb: could not connect to database template1: FATAL user "root" does not exist
> 
>   what is the error I am facing anyway?

On installation the only user is "postgres". You don't say what system
you are running but the server should be configured so that running
createuser as the same user as the server should work. Once you've
created additional users you're set.

You can use -U to set the user to connect as.

Have a nice day,
-- 
Martijn van Oosterhout      http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Re: Creating of User and Database

От:
FirstDBA@gmail.com
Дата:
After you install postgres using 'root', create your postgres database
cluster (initdb ....) as "postgres" rather than "root". Your database
files therefore should be owned by "postgres" not root.

--
  Husam
  http://firstdba.googlepages.com


Martijn van Oosterhout wrote:
> On Thu, May 11, 2006 at 10:35:12AM +0800, APSC, Patrick Chee Seng Onn wrote:
> > Hi,
> >
> >   I've just installed postgresql onto my system but unable to successfully add new users and databases. I would receive a error message:
> >
> > 	createuser: could not connect to database template1: FATAL user "root" does not exist
> >
> > 	createdb: could not connect to database template1: FATAL user "root" does not exist
> >
> >   what is the error I am facing anyway?
>
> On installation the only user is "postgres". You don't say what system
> you are running but the server should be configured so that running
> createuser as the same user as the server should work. Once you've
> created additional users you're set.
>
> You can use -U to set the user to connect as.
>
> Have a nice day,
> --
> Martijn van Oosterhout      http://svana.org/kleptog/
> > From each according to his ability. To each according to his ability to litigate.
>
> --MnLPg7ZWsaic7Fhd
> Content-Type: application/pgp-signature
> Content-Transfer-Encoding: base64
> Content-Disposition: inline;
> 	filename="signature.asc"
> Content-Description: Digital signature
> X-Google-AttachSize: 190

FAQ