windows下postgresql的使用注意问题

windows下postgresql的使用注意问题
(1).下载bin的解压版本
(2).解压为:D:\demo\PostgreSQL\
(3).创建非管理员用户,如:postgresql,并将目录:D:\demo\PostgreSQL\pgsql\data的权限赋给用户postgresql
(4).以用户postgresql初始化并启动数据库,如下:
(5).初始化postgre数据库:initdb.exe -D D:\demo\PostgreSQL\pgsql\data
(6).运行postgre数据:postgres.exe -D D:\demo\PostgreSQL\pgsql\data
(7).调整配置文件:
(7.1) D:\demo\PostgreSQL\pgsql\data\postgresql.conf
修改为:
////////////////////begin//////////////
listen_addresses = ‘*’
port = 5432
////////////////////end///////////////
(7.2) D:\demo\PostgreSQL\pgsql\data\pg_hba.conf
修改并添加为:此处用来限制哪些客户端可以访问数据库服务器。
////////////////////begin//////////////
# IPv4 local connections:
host all all 127.0.0.1/32 trust
host all all 192.168.1.8/32 trust
host all all 192.168.1.205/32 trust
////////////////////end///////////////
注意:测试时,postgresql安装在192.168.1.8上,远程应用服务器tomcat安装在192.168.1.205上。
(8).创建数据库:createdb.exe cnd
(9).连接数据库:psql.exe cnd
注意:数据库名为cnd

(10).远程访问数据库:psql.exe -h 192.168.1.8 -p 5432 cnd postgresql
转载自:https://blog.csdn.net/can_do_it/article/details/84771972

You may also like...