2012年1月28日土曜日

postgreSQL

バージョンは違いますが、この操作で使用する環境になりました。
https://forum.openwrt.org/viewtopic.php?id=11812
パッケージは既に導入済みなのでその他の設定から。
BusyBox v1.15.3 (2011-10-29 04:41:06 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 Backfire (10.03.1-RC6, r28680) --------------------
  * 1/3 shot Kahlua    In a shot glass, layer Kahlua
  * 1/3 shot Bailey's  on the bottom, then Bailey's,
  * 1/3 shot Vodka     then Vodka.
 ---------------------------------------------------
root@PRIME400:~# uci set postgresql.config.PGDATA=/srv/postgresql/data
root@PRIME400:~# uci set postgresql.config.PGLOG=/srv/postgresql/data/postgresql.log
root@PRIME400:~# uci commit
root@PRIME400:~# mkdir -p /srv/postgresql/data
root@PRIME400:~# chown postgres /srv/postgresql/data
root@PRIME400:~# su - postgres


BusyBox v1.15.3 (2011-10-29 04:41:06 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 Backfire (10.03.1-RC6, r28680) --------------------
  * 1/3 shot Kahlua    In a shot glass, layer Kahlua
  * 1/3 shot Bailey's  on the bottom, then Bailey's,
  * 1/3 shot Vodka     then Vodka.
 ---------------------------------------------------
postgres@PRIME400:~$ LC_COLLATE="C" initdb --pwprompt -D /srv/postgresql/data
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 C.
The default database encoding has accordingly been set to SQL_ASCII.
The default text search configuration will be set to "english".

fixing permissions on existing directory /srv/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 28MB
creating configuration files ... ok
creating template1 database in /srv/postgresql/data/base/1 ... ok
initializing pg_authid ... ok
Enter new superuser password:[ここでDBのパスワードを設定]
Enter it again:[ここでDBのパスワードを再入力]
setting password ... 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
loading PL/pgSQL server-side language ... 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:

    postgres -D /srv/postgresql/data
or
    pg_ctl -D /srv/postgresql/data -l logfile start
postgres@PRIME400:~$ exit
root@PRIME400:/# /etc/init.d/postgresql start
starting postgres...
ok
root@PRIME400:/# /etc/init.d/postgresql enable
root@PRIME400:/# su - postgresql
postgres@PRIME400:~$ psql
psql (9.0.1)
Type "help" for help.

postgres=#
これで無事動く状態になりました。

0 件のコメント:

コメントを投稿