ちょっと、DB2から離れて、postgresqlをCENTOSにインストールする方法をメモしておきます。
- rootにて以下のコマンドを実行 # yum -y install postgresql-server
- 上記にてインストールが完了したらpostgressqlを起動する # /etc/rc.d/init.d/postgresql start データベースを初期化中: [ OK ] postgresql サービスを開始中: [ OK ]
- 自動起動設定を、"ON"にする # chkconfig postgresql on
- インストール時に、postgresのアカウントが自動的に作成されている。よって、パスワードだけ変更する。 # passwd postgres Changing password for user postgres. New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully.
- postgres ユーザーに、suして、接続を試みる # su postgres bash-3.2$ psql template1 Welcome to psql 8.1.11, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help with psql commands \g or terminate with semicolon to execute query \q to quit
- パスワードを、上記4と同じパスワードに設定する。(単純に忘れないため) template1=# alter user postgres with password '**********'; ALTER ROLE
- 以上で、一旦quitする。 template1=# \q bash-3.2$
うん、インストール楽々でした。。。