2012年5月31日 星期四

phppgadmin 有時候PHP會沒有連到postgres的模組 postgres postgresql

您的 PHP 環境未安裝必需的資料庫支援。
yum -y install php php-pgsql


然後需要建立一個postgres的密碼
sudo passwd postgres
建立密碼,但是這個帳號是沒有辦法元端連線的


此時這時候服務還沒起來
cd /etc/init.d
ll | grep post
會找到postgresql這個服務
service postgresql restart會發生錯誤,跟你說,還沒有初始化資料庫
這時候先
service postgresql initdb

service postgresql restart


-------
這時候再來建立可以外部連線的帳密
進入postgres的shell
su - postgres
然後
psql template1
這個資料庫

create user twsc_card with PASSWORD 'card20101213';




$conf['extra_login_security'] = false;






默认情况下服务中的postgresql没有启动,需要将该服务前的选择框勾上,点击开始,操作系统报告如下错误:postgresql failedThe error was:/var/lib/pgsql/data is missing. Use “Service postgresql initdb” to initialize the cluster first.说明postgresql数据目前还没有初始化,执行“Service postgresql initdb”服务就立即可以启动了,在命令行方式重启动服务也是使用“Service postgresql restart”,好像和以前有一点点不同。

沒有留言:

張貼留言