我使用PHP,Mysql和Codeignater版本3創建一個網站。然後在iPage上託管它。當我現場上傳時,我在配置文件中進行更改。mysqli :: real_connect():(HY000/2002):實時拒絕連接
$db['default'] = array(
'dsn' => '',
'hostname' => '66.96.147.118',
'username' => 'bit_root',
'password' => 'root',
'database' => 'bit_shilp',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
我使用codeignater版本3.在本地它很好。但在現場,它給出了一個錯誤。
請訪問以下鏈接http://bitshilp.com/BitShilp/index.php/home
它給出這樣的錯誤:
一個PHP錯誤遇到
嚴重性:警告
消息:mysqli的:: real_connect() :(HY000/2002):拒絕連接
文件名:mysqli/mysqli_driver.php
行號:161
回溯:
文件:/hermes/bosnaweb13a/b2582/ipg.bitshilpcom/BitShilp/application/controllers/Home.php 行:7 功能: __construct
文件:/hermes/bosnaweb13a/b2582/ipg.bitshilpcom/BitShilp/index.php 線:292 功能:require_once遇到 一個PHP錯誤
嚴重性:警告
消息:無法修改標題信息 - 頭已經發出(輸出開始 /hermes/bosnaweb13a/b2582/ipg.bitshilpcom/BitShilp/system/core/Exceptions.php:272)
文件名:核心/的common.php
行號:568
回溯:
文件:/hermes/bosnaweb13a/b2582/ipg.bitshilpcom/BitS HILP /應用/控制器/ Home.php 線:7 功能:__construct
文件:/hermes/bosnaweb13a/b2582/ipg.bitshilpcom/BitShilp/index.php 線:292 功能:require_once
謝謝。
bit_root權限看起來像''bit_root'@'%''? –
參數是否正確? –
我希望爲了你自己的緣故,你的數據庫服務器位於'66.96.147.118'(我假設你粘貼了真實地址?出於安全原因,你不應該再這樣做)不接受該外部地址上的MySQL連接。在大多數情況下,一旦代碼在服務器上,您需要連接到本地主機或其他本地地址。 – shevron