install PostgreSQL on openWRT

1.requierment:

make sure you can run these command on your shell
adduser , deluser, addgroup, delgroup, su

2.install packeages
opkg update
opkg install pgsql-server pgsql-cli

3. change the path of datebase and log file.

uci set postgresql.config.PGDATA=/srv/postgresql/data

uci set postgresql.config.PGLOG=/srv/postgresql/data/postgresql.log

uci commit


4. initial databse

mkdir -p /srv/postgresql/data

chown postgres /srv/postgresql/data

sudo -u postgres
$LC_COLLATE="C" initdb --pwprompt -D /srv/postgresql/data


when the command finish, follow the output to start database
pg_ctl -D /srv/postgresql/data -l logfile start

评论

此博客中的热门博文

xRDP – How to Install on Linux Mint

树莓派SPI连接TFT屏幕