http://iotn.co.kr ¿¬¶ôó: gilho.kr@gmail.com [ The Japanese government should apologize to Japanese Military Sexual Slavery victim. / ìíÜâïÙݤªÏìíÜâÏÚªÎàõîÜÒ¿ÖË?ßåíºªËÞóñªª¹ªÙª. ]
DB ¿î¿µÁß instance Ãß°¡ / port, DB À§Ä¡ ´Ù¸£¸é °¡´É
-bash-4.1$ rm -rf /var/lib/pgsql/test
-bash-4.1$ /usr/bin/initdb -D /var/lib/pgsql/test
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale en_US.UTF-8.
The default database encoding has accordingly been set to UTF8.
The default text search configuration will be set to "english".
creating directory /var/lib/pgsql/test ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in /var/lib/pgsql/test/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.
Success. You can now start the database server using:
/usr/bin/postgres -D /var/lib/pgsql/test
or
/usr/bin/pg_ctl -D /var/lib/pgsql/test -l logfile start
-bash-4.1$ vi /var/lib/pgsql/test/postgresql.conf
listen_addresses = '*'
port = 5433
-bash-4.1$ /usr/bin/pg_ctl -D /var/lib/pgsql/test -l logfile start
server starting
-bash-4.1$ psql -h localhost -p 5433
psql (8.4.20)
Type "help" for help.
postgres=# \du
List of roles
Role name | Attributes | Member of
-----------+-------------+-----------
postgres | Superuser | {}
: Create role
: Create DB
postgres=# \q
-bash-4.1$ pg_ctl stop -D /var/lib/pgsql/test
waiting for server to shut down.... done
server stopped