PosgreSQL

sudo-s(root进入文件夹)

export PGDATA=/var/lib/pgsql/9.6/data

重启postgres:  ./pg_ctl restart

 

 

/var/lib/pgsql/data

 

/usr/bin/pg_ctl   /usr/pgsql-9.6/bin/pg_ctl

 

 postgres改密码

 

sudo su postgres

psql

alter user postgres with password 'new password';  

 

psql读取.sql文件,初始化数据库

psql -d qing_lapp -f /data/init.sql 

psql 修改字段类型ALTER TABLE tbl_name ALTER COLUMN col_name TYPE varchar (11);

 

 

 

postgres安装步骤:

yum install postgresql-server(会顺便装pg)

service postgresql initdb (初始化数据库,以及配置文件)

然后修改data下的pg_hba.conf  以及postgresql.conf

 

pg_hba.conf  的address 有的不支持all 可以写出0.0.0.0/0  或者不写all,安全

 

猜你喜欢

转载自jaycehong.iteye.com/blog/2379038