免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 4806 | 回复: 10
打印 上一主题 下一主题

postgresql在win上的安装,求教 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-07-12 00:26 |只看该作者 |倒序浏览
PostgreSQL将从7.5版开始支持windows.
http://www.hagander.net/pgsql/win32snap/
我看这里面的安装指南:

Setting Up the Server


1. Unzip download into a folder of your choice (example: c:\postgres)
2. Add the newly created bin and lib folder to your path (inside the NT environment settings).
3. Add PGDATA environment variable to point to the folder which will contain your database (c:\postgres\data).

4. Open a new command window and type: initdb -L "c:/postgres/share" (note the unix style slashes for compatibility reasons). If you get a bad command error, your path is not set up properly. If you see no error messages, the template database is constructed and the server is ready to be started.
5. From the command window, type: postmaster. This will start the server. Leave this window open as long as you want the server to run. To shut down the server, close the window or press Control-C while the window has the focus.
6. Open another command window and type psql template1. Success indicates the server is running and you have logged into the server. You will probably want to create a database right away. For further information on setting up and administrating PostgreSQL please check out the standard documentation.

第2步和第3步不懂是什么意思???

论坛徽章:
0
2 [报告]
发表于 2004-07-12 03:34 |只看该作者

postgresql在win上的安装,求教

應該是 在 os 中
set path=%path%;c:\postgres\data;c:\postgres\BIN;c:\postgres\LIB

如何 set 語法 自行檢查

论坛徽章:
0
3 [报告]
发表于 2004-07-12 12:16 |只看该作者

postgresql在win上的安装,求教

ok 解决.谢谢lschang~

论坛徽章:
0
4 [报告]
发表于 2004-07-12 13:01 |只看该作者

postgresql在win上的安装,求教

见附件/

qqqq.gif (19.32 KB, 下载次数: 43)

qqqq.gif

论坛徽章:
0
5 [报告]
发表于 2004-10-06 22:24 |只看该作者

postgresql在win上的安装,求教

两位好:我下载的是PostgreSQL 8.0-beta2-dev3 也看了这里
http://www.hagander.net/pgsql/win32snap/

但好像比上面的有所更新,大致如下:

Installing the Server

1. Unzip download into a folder of your choice (example: c:\postgres)
2. Add the newly created bin and lib folder to the system path (inside the NT environment settings).
3. Add PGDATA environment variable to point to the folder which will contain your database (c:\postgres\data).
Creating the Postgres User and Testing Server Execution


1. Create a user called postgres or use an existing user. That user should have the 'log on as a service' right but must not have Administrator rights. The postgres user should have a password.
2. Make sure the postgres user has read/write/execute rights to the postgresql folders.
3. Open a command window and type: runas /noprofile /user:postgres cmd. You will be prompted for the password. This will open a new command window under the postgres user's security context.
4. Type PATH to check the path. Confirm that the postgresql bin and lib folders are in the file search path. If they are not, you can add them from the command line or through the environment settings (if you log into the desktop as the postgres user). Also make sure the PGDATA environment variable is still available by typing SET.
5. Type: initdb -L "c:/postgres/share" (note the unix style slashes for compatibility reasons). If you get a bad command error, your path is not set up properly. If you see no error messages, the template database is constructed and the server is ready to be started.
6. Grant the postgres user read/write permissions to the newly created data folder.
7. From the command window, type: postmaster. This will start the server. Leave this window open as long as you want the server to run. To shut down the server, press Control-C while the window has the focus. Shut down the server.
8. To register the postgresql service, open a new cmd window as a user with administrative privileges and type pg_ctl register -U postgres -P passwd. This will install the PostgreSQL service. You may now close down the postgres user's command window.
9. To start the service, type net start postgresql from a command window or start the service from the service manager.



有几点不清楚地地方:
Add PGDATA environment variable  :的意思就是在设定一个path变量吗?
我先在操作系统里创建了一个用户postgres,然后安装,在安装的时候选择
“register the postgresql service” 账号是就是postgres然后在安装完毕时候执行
initdb -L "c:/postgres/share"

postmaster

出现如图这样的提示

message.JPG (49.11 KB, 下载次数: 44)

message.JPG

论坛徽章:
0
6 [报告]
发表于 2004-10-06 22:31 |只看该作者

postgresql在win上的安装,求教

为什么会有 c:\postgres\data 存在的提示呢? 我是在PATH里定义 加了一个 pgdata 值为c:\postgres\data。

执行postmaster的时候,给出提示说出于安全原因我不应该用当前的系统目录,而应该用之前创建的postgres,那我在启动数据库的时候怎么来自行指定用哪个用户呢?

谢谢

论坛徽章:
0
7 [报告]
发表于 2004-10-06 22:34 |只看该作者

postgresql在win上的安装,求教

控制面板里可以正常启动服务。

论坛徽章:
0
8 [报告]
发表于 2004-10-07 07:58 |只看该作者

postgresql在win上的安装,求教

[quote]原帖由 "nullfox"]见附件/[/quote 发表:


我之前有篇文章讲到的,看来大家都没注意到,建议斑竹置顶。

http://bbs.chinaunix.net/forum/18/20040816/387789.html
【分享】 PostgreSQL 8.0 beta 的 Win32 版下载和使用

......
4) 直接运行 Pgsql init 会导致 administrative permission 的问题。
所以你必须先建立一个普通用户 Public User,密码可以是 welcome。

每次运行 Pgsql 前,先运行 Pgusr,输入密码,进入普通用户模式。
在普通用户命令行里,请注意中断符是 Ctrl-Break 而不是 Ctrl-C。

......
如果用 hagander 的版本,我试过了应该这样用。其他的环境变量如
PGHOME、PGDATA 照旧,按 laser 的文档或我的文档。

1) set TZ=PRC
2) initdb --locale=C

论坛徽章:
0
9 [报告]
发表于 2004-10-07 09:37 |只看该作者

postgresql在win上的安装,求教

wwashington ,
  谢谢,我下载的压缩包里面没有pgsql_cmd.rar 只有一个postgresql-8.0-beta2-dev3.msi,请问在http://www.postgresql.org 上能找到这个文件吗?

论坛徽章:
0
10 [报告]
发表于 2004-10-07 14:46 |只看该作者

postgresql在win上的安装,求教

那个是我自己写的批处理文件,懒得输入长命令行,用久了就习惯了。

你去我的站点下载吧,postgresql.org 站点没有的。但是我记得好象
以前在某个地方看过关于 runas 的说明,你在 Win2k/Xp 的 cmd
提示符下输入 runas /? 就知道怎么用了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP