postgres 계정으로 createdb 를 하셨는지요.
그렇지 않다면 DB creation privilege 를 가진 DB user 계정으로 createdb 를 시행하셔야 합니다. 아마도 그렇지 않은 것 같은 생각이 많이 듭니다.
createdb 문법은 man createdb 하시면 자세히 나와 있습니다. 참고하시기 바랍니다.
SYNOPSIS
createdb [ options... ] [ dbname ] [ description ]
INPUTS
-h, --host host
Specifies the hostname of the machine on which the postmaster is running. If host begins with a
slash, it is used as the directory for the Unix domain socket.
-p, --port port
Specifies the Internet TCP/IP port or the local Unix domain socket file extension on which the
postmaster is listening for connections.
-U, --username username
Username to connect as.
-W, --password
Force password prompt.
-e, --echo
Echo the queries that createdb generates and sends to the backend.
-q, --quiet
Do not display a response.
-D, --location datadir
Specifies the alternative location for the database. See also initlocation(1).
-T, --template template
Specifies the template database from which to build this database.
-E, --encoding encoding
Specifies the character encoding scheme to be used in this database.
dbname Specifies the name of the database to be created. The name must be unique among all Postgres
databases in this installation. The default is to create a database with the same name as the cur?
rent system user.
description
This optionally specifies a comment to be associated with the newly created database.
The options -h, -p, -U, -W, and -e are passed on literally to psql(1). The options -D, -T, and -E are
converted into options for the underlying SQL command CREATE DATABASE [create_database(l)]; see there for
more information about them.
-- 송정훈 님이 쓰신 글:
>> 우선 저는 db는 처음입니다.
>> 저는 Securing & Optimizing LINUX 7.1 의 PostgreSql(7.1.3)의 문서를보고 설치하였읍니다.
>>
>> 첫째질문은 createdb 을 실행하였을때의 에러입니다.
>> bash-2.04$ createdb openna
>> Password:
>> ERROR: CREATE DATABASE: source database "template1" is being accessed by other users
>> createdb: database creation failed
>> bash-2.04$ psql -l
>> Password:
>> List of databases
>> Database | Owner | Encoding
>> -----------+----------+----------
>> template0 | postgres | EUC_KR
>> template1 | postgres | EUC_KR
>> (2 rows)
>>
>>
>> 두번째질문은 psql or postgres 계정에서 사용자와 비번은 잘만들어 지는데
>> 사용자명과는 다른 그사용자의 db명을 만드는 문제입니다.
>> 여기의 예제는 createdb /U new_user /E EUC_KR new_db
>> 인데 혹시 createdb -U new_user -E EUC_KR new_db
>> 아닌가요.
>>
>> ps... 다른설정은 다잘됨니다...(여러분들의 조언을 부탁합니다.)
|