- 论坛徽章:
- 0
|
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
出现如图这样的提示 |
|