postgresql在windows上的安装说明

http://www.enterprisedb.com/products-services-training/pgbindownload
在上面网址下载postgresql在windows下的压缩包
将postgresql解压缩到一个目录D:\tmp\

然后运行下面命令
C:\Users\Administrator>d:

D:\>cd D:\tmp\pgsql\bin
手动在D:\tmp\pgsql下新建data文件夹
D:\tmp\pgsql\bin>initdb -D D:\tmp\pgsql\data
属于此数据库系统的文件宿主为用户 "Administrator".
此用户也必须为服务器进程的宿主.
The database cluster will be initialized with locale "Chinese (Simplified)_Peopl
e's Republic of China.936".
Encoding "GBK" implied by locale is not allowed as a server-side encoding.
The default database encoding will be set to "UTF8" instead.
initdb: could not find suitable text search configuration for locale "Chinese (S
implified)_People's Republic of China.936"
缺省的文本搜索配置将会被设置到"simple"

修复已存在目录 D:/tmp/pgsql/data 的权限 ... 成功
正在创建子目录 ... 成功
选择默认最大联接数 (max_connections) ... 100
选择默认共享缓冲区大小 (shared_buffers) ... 32MB
创建配置文件 ... 成功
在 D:/tmp/pgsql/data/base/1 中创建 template1 数据库 ... 成功
初始化 pg_authid ...  成功
初始化dependencies ... 成功
创建系统视图 ... 成功
正在加载系统对象描述 ...成功
creating collations ... not supported on this platform
创建字符集转换 ... 成功
正在创建字典 ... 成功
对内建对象设置权限 ... 成功
创建信息模式 ... 成功
正在装载PL/pgSQL服务器端编程语言...成功
清理数据库 template1 ... 成功
拷贝 template1 到 template0 ... 成功
拷贝 template1 到 template0 ... 成功

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

成功. 您现在可以用下面的命令运行数据库服务器:

    ""postmaster -D "D:/tmp/pgsql/data"
或者
    ""pg_ctl -D "D:/tmp/pgsql/data" -l logfile start


D:\tmp\pgsql\bin>pg_ctl -D "D:/tmp/pgsql/data" -l logfile start
server starting

D:\tmp\pgsql\bin>createdb test

D:\tmp\pgsql\bin>psql test
psql (9.2.1)
输入 "help" 来获取帮助信息.

test=# help
您正在使用psql, 这是一种用于访问PostgreSQL的命令行界面
键入: \copyright 显示发行条款
       \h 显示 SQL 命令的说明
       \? 显示 pgsql 命令的说明
       \g 或者以分号(;)结尾以执行查询
       \q 退出

猜你喜欢

转载自arienya.iteye.com/blog/1720128