問(wèn)題描述
我在服務(wù)器上運(yùn)行的 CodeIgniter 應(yīng)用程序中出現(xiàn)以下錯(cuò)誤.
I am getting Following error in my CodeIgniter application which is live on server.
這是錯(cuò)誤的輸出:
遇到 PHP 錯(cuò)誤
嚴(yán)重性:警告
消息:mysqli::real_connect():(HY000/1044):用戶訪問(wèn)被拒絕'xxx'@'localhost' 到數(shù)據(jù)庫(kù) 'xxx'
Message: mysqli::real_connect(): (HY000/1044): Access denied for user 'xxx'@'localhost' to database 'xxx'
文件名:mysqli/mysqli_driver.php
Filename: mysqli/mysqli_driver.php
行號(hào):161
回溯:
文件:/home/arya123/public_html/application/controllers/Home.php 行:7 函數(shù):__construct
File: /home/arya123/public_html/application/controllers/Home.php Line: 7 Function: __construct
文件:/home/arya123/public_html/index.php 行:292 功能:需要一次
File: /home/arya123/public_html/index.php Line: 292 Function: require_once
推薦答案
你必須設(shè)置 mysql 端口號(hào),默認(rèn)為 3306 在database.php 中檢查
you have to set mysql port number which is by default 3306 check this in database.php
使用任何一個(gè)
'dbport' => '3306',
或
'hostname' => 'mysql.hostingprovider.com:3306',
這篇關(guān)于嘗試使用 mysqli 連接到數(shù)據(jù)庫(kù)時(shí)出現(xiàn) Codeigniter 錯(cuò)誤的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!