访问phpmyadmin在线托管后的代码点火器数据库错误

时间:2019-06-26 16:47:32

标签: mysql codeigniter xampp

遇到PHP错误

Severity: Warning

Message: mysqli::real_connect(): (HY000/1045): Access denied for user ''@'localhost' (using password: YES)

Filename: mysqli/mysqli_driver.php

Line Number: 203

Backtrace:

File: E:\xampp\htdocs\website_ci\application\controllers\Welcome.php
Line: 8
Function: __construct

File: E:\xampp\htdocs\website_ci\index.php
Line: 315
Function: require_once

我尝试重新安装xampp,但仍然出错

在尝试设置在线主机上的phpmyadmin之前,当我尝试访问localhost时出现了这样的错误

1 个答案:

答案 0 :(得分:0)

  

config / database.php

$db['default']=array(
'dsn'=>'',
'hostname'=>'localhost',
'username'=>'root',
'password'=>'',
'database'=>'database_name',
'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

);