Win10下载安装PostgreSQL 11.1

下载地址:https://get.enterprisedb.com/postgresql/postgresql-11.1-1-windows-x64.exe

Installation Directory:D:\Program Files\PostgreSQL\11
Data Directory:D:\data\PostgreSQL\data
Please provide a password for the database superuser (postgres).
Password:password
Port:5432
Locale:[Default locale]

报错:

Problem running post-install step. Installation may not complete correctly
Failed to start the database server.

创建一个名为postgres的用户,密码设置为password,并且将其权限设置成了管理员。
然后卸载之前安装的所有PostgreSQL组件,重新安装。
Locale改成:C

还是有问题,卸载,重启。再次安装。依然失败。

参照这篇教程:http://www.voidcn.com/article/p-ujhdgeom-brr.html
首先将D:\Program Files\PostgreSQL\11\bin添加进环境变量Path中。
然后在命令行执行:

initdb.exe -D D:\data\PostgreSQL\data -E UTF8

然后执行如下命令启动PostgreSQL服务器:

pg_ctl -D D:\data\PostgreSQL\data -l D:\data\PostgreSQL\logfile.txt start

在命令行执行

psql postgres

进入psql客户端的命令行,执行如下命令创建一个名为root密码为password的超级用户:

create user root with superuser password 'password';

然后使用DBEaver连接本地Postgres服务器,连接成功。

posted @ 2019-01-19 00:48  zifeiy  阅读(5204)  评论(1编辑  收藏  举报