PHPCMS V9數(shù)據(jù)庫配置文件database.php位置

2013-04-01 12:28:47來源:西部e網(wǎng)作者:

初次用PHPCMS V9的朋友可能找不到數(shù)據(jù)庫配置文件,其實(shí)在官方的wiki中已經(jīng)介紹了。那就是 caches\configs\database.php 文件。

初次用PHPCMS V9的朋友可能找不到數(shù)據(jù)庫配置文件,其實(shí)在官方的wiki中已經(jīng)介紹了。那就是 caches\configs\database.php 文件。

在本地做好了網(wǎng)站之后,上傳到服務(wù)器上,就要修改caches\configs\database.php 文件才能正常訪問數(shù)據(jù)庫,否則會(huì)出現(xiàn)如下錯(cuò)誤信息:

MySQL Query :
MySQL Error :
MySQL Errno : 0
Can not connect to MySQL server

<?php

return array (
 'default' => array (
  'hostname' => 'localhost', //服務(wù)器名稱
  'database' => 'phpcmsv9', //數(shù)據(jù)庫名
  'username' => 'root', //數(shù)據(jù)庫用戶名
  'password' => '88888888', //密碼
  'tablepre' => 'pc9_', //數(shù)據(jù)庫前綴,可以是任意,如沒特殊要求
  'charset' => 'utf8', //數(shù)據(jù)庫字符集
  'type' => 'mysql', //數(shù)據(jù)庫類型
  'debug' => true, //是否開啟錯(cuò)誤提示
  'pconnect' => 0, //是否永久連接數(shù)據(jù)庫 0,不是 1,是
  'autoconnect' => 0
  ),
);

?>

修改其中的hostname,database,username和password值內(nèi)容為服務(wù)器相關(guān)的值就可以了。

關(guān)鍵詞:PHPCMS配置文件

贊助商鏈接: