安装PostgreSQL 14.2.1遇到错误

出现以下错误:
Problem running post-install step. Installation may not complete correctly
Failed to start the database server.

启动Windows PowerShell跳转到cd "E:\Program Files\PostgreSQL\14\bin"

(1).\initdb -D "E:\Program Files\PostgreSQL\14\data" -U postgres
(2).\pg_ctl register -N postgresql-14 -D "E:\Program Files\PostgreSQL\14\data

出现提示乱码解决方案:
修改postgresql.cnf的参数lc_messages的值,由“Chinese (Simplified)_People”改为“UTF8”,问题解决。

(3)设置postgres的密码
alter user postgres with password '123456';
编辑修改文件 pg_hba.conf, 把连接权限设置的 trust加密方式 改成md5

重启服务

可能用到的命令
删除 windows服务 sc.exe delete "服务名称"

posted @ 2022-04-11 05:16  黑魔术师与黑魔术少女  阅读(196)  评论(0编辑  收藏  举报
1 3 levels of contents