Chinaunix首页 | 论坛 | 博客
  • 博客访问: 812925
  • 博文数量: 167
  • 博客积分: 7173
  • 博客等级: 少将
  • 技术积分: 1671
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-04 23:07
文章分类

全部博文(167)

文章存档

2018年(1)

2017年(11)

2012年(2)

2011年(27)

2010年(88)

2009年(38)

分类:

2011-06-27 17:59:54

#tar zxvf *.tar.gz
#cd /data/sky/postgresql-9.0.4
#./configuire --prefix=/data/sky/postgresql
#make && make install
#useradd postgres
#mkdir /data/sky/postgresql/data
#chown -R postgres:postgres /data/sky/postgresql
#su - postgres
$/data/sky/postgresql/bin/initdb -D /data/sky/postgresql/data -E utf8 --no-locale
 /*
  *initdb命令请参考initdb --help 或 initdb命令.doc
  *默认读取服务器中的字符集,我机器上的字符集为zh_CN.GB18030
  *不在所支持的字符集里面,所以我使用utf8 请查看 字符集支持.doc
  *--no-locale加上这个不使用系统的东西
  */
-----------------------------成功提示如下------------------------------------
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale C.
The default text search configuration will be set to "english".

fixing permissions on existing directory /data/sky/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in /data/sky/postgresql/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
loading PL/pgSQL server-side language ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok

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

Success. You can now start the database server using:

    /data/sky/postgresql/bin/postgres -D /data/sky/postgresql/data
or
    /data/sky/postgresql/bin/pg_ctl -D /data/sky/postgresql/data -l logfile start
---------------------------------------------------------------------------------

/*
 *成功初始化,会在data目录下生成相应的文件;
 *请注意postgresql.conf,pg_hba.conf文件;如果用于生产环境需要进行优化配置。
 *
 */


./createuser -d -e -P -l -r -s --host=127.0.0.1 --port=5432  相当于创建超级用户
./createdb -e --owner=root --host=127.0.0.1 --port=5432  mydb 创建mydb库
./psql --dbname=mydb --host=127.0.0.1 --port=5432 登录mydb

阅读(950) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~