數據庫錯誤連接到你的數據庫服務器發生笨:無法使用提供
無法使用提供的設置連接到你的數據庫服務器。
文件名:庫/會話/ session.php文件
行號:102
我爲CI新手,去我開始dB到我的網站,我得到這個錯誤,我不知道如何reslove。
你能解決這個錯誤嗎?
的application/config/database.php中
$active_group = 'default';
$query_builder = TRUE;
require_once('mainconfig.php');
$db['default'] = array(
'dsn' => '',
'hostname' => $config['mysql_host'],
'username' => $config['mysql_username'],
'password' => $config['mysql_password'],
'database' => $config['mysql_database'],
'dbdriver' => $config['mysql_driver'],
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => TRUE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => $config['mysql_charset'],
'dbcollat' => $config['mysql_dbcollat'],
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
的application/config/mainconfig.php
defined('BASEPATH') OR exit('No direct script access allowed');
$config['mysql_host'] = 'localhost';
$config['mysql_username'] = 'xxxcc';
$config['mysql_password'] = 'xxxcc';
$config['mysql_database'] = 'xxccv';
$config['mysql_driver'] = 'mysqli';
$config['mysql_charset'] = 'utf8';
$config['mysql_dbcollat'] = 'utf8_general_ci';
$config['base_js'] = 'assets/js';
$config['base_css'] = 'assets/css';
$config['base_plugins'] = 'assets/plugins';
$config['base_images'] = 'assets/images';
$config['base_fonts'] = 'assets/font-awesome';
$config['other_base'] = 'assets/fonts';
$config['email_author'] = '[email protected]';
$config['limit'] = 7;
檢查application/config/database.php中的數據庫連接 –
需要更多信息。 – user4419336