(转)windows xp 下安装 postgresql8.4 报错 The database cluster initialization failed

在xp下安装 postgresql8.4 第一次选择的方式是local方式,安装报错说是一个conf文件出错,然后就是“The database cluster initialization failed”这个错误。后来在google了查了好久都说应该选择“C”就可以了,选择后还是没什么效果。卸载的时候也服务的错,卸载后发现服务还在,后来只能用 “sc delete”+服务名删除了对应的服务。

然后这样又安装了几次,每次都报“The database cluster initialization failed”错误!怎么会这样的,无线苦恼。觉得应该是老文件出现的问题,所以想换一个安装目录,但是发现后面的每次安装不再提醒输入安装目录了,而是安装在以前的目录里。后来发现安装的目录里有一个uninstall-postgresql.exe文件,用这个程序卸载后,这样再安装就会提醒安装目录了,改了一个安装目录,在选择的时候选择“c”就行,这次安装成功搞定!

在用pgAdmin连接数据库的时候,报密码错误,一看提醒的用户名是administrator密码错误,用户名修改为默认安装时候的postgresql就成功连接了。

附:相关资料

PostgreSQL Database Cluster Initialisation Failed Solution


Want to read our new posts as they are published? Subscribe to our feed or by email for instant updates. Thanks for visiting and keep visiting!

I’ll keep this one short and sweet. For those of you that have tried to install PostgreSQL (mine was 8.3.7-1) on Windows Vista and got the error Database Cluster Initialisation Failed error at the end of the install, read this.

The problem is that Vista has some safety features associated with setting permissions on the Program Files folder. Basically, even if you are an admin, you can’t change permissions on some folders like Program Files and Windows folder itself. This causes initdb to be unable to create some folders and the database cluster. What this means for you is that you need to install PostgreSQL in another folder that is not inside Program Files.

By the way, if you have forgotten your Postgres account password while installing the first time, just open a Command Prompt in Vista (If you don’t know how, Google for it). Then type the command “net user”. You will see a list of users on your computer. Find Postgre’s account. It’s usually “postgres“. Then you need to change its password by typing “net user postgres new_password” where new_password is… well, a new password for the account. You will be needing that postgres account during install. You will need admin privileges to do this change however.

Firstly, uninstall any failed installations. Use the Control Panel or the PostgreSQL installer in the install folder.

During the install, you will be prompted to choose where you want to install the program. Just select a location in another place. Like “C:\PostgreSQL” or something similar. It may even be on your desktop. But not inside Program Files. Not inside Windows folder. However, it’s not as easy. Bear with me.

After the install, you will still see that darned error message (or something like non-fatal error occured). Do not despair! (For Windows Power Users, we are just assigning Full Control permission to Postgres account on the new PostgreSQL install folder). For other users, read on if you don’t know how to do it.

Go to where you just installed PostgreSQL. In this case, the C: drive. There, right-click on the folder (usually called PostgreSQL), and go to Properties – Security tab. Click on the Edit button. You will now see some usernames and other stuff. Click on the Add button. In the “Enter the object names to select” box, enter “postgres” and press Check. Postgres’ user account should appear there. Click on Ok.

Now from the “Group or Usernames” box, select the Postgres account. In the window below, with lots of checkboxes, assign permission “Full Control” in the Allow Column to it. Note, if you don’t want to allow full control, just give it read/write. But I just went ahead and gave it Full Control. (I was tired and annoyed. The “World’s most advanced open source database” had failed to install!). Click on Ok and wait a bit for permissions to be applied.

Then, just do a re-install. Do not uninstall anything. Just run the setup again. It’ll say that a PostgreSQL install folder already exists and other stuff. Just click on Next until the install finishes. If you see “file cannot be copied” errors, click on the “ignore” button when needed.

That’s it. PostgreSQL should be up and running on Vista now. Hope it works for you too as it did for me, and that my guide is helpful to anybody. If it works, or if you have other solutions, let us know. Thanks for reading!

转载于:https://www.cnblogs.com/Roube/archive/2012/04/17/2454021.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值