【问题标题】:Code igniter database error after access phpmyadmin online hosting访问 phpmyadmin 在线托管后 Codeigniter 数据库错误
【发布时间】:2019-11-08 16:24:35
【问题描述】:

遇到了 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 时出现这样的错误

【问题讨论】:

标签: mysql codeigniter xampp


【解决方案1】:

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

);

【讨论】:

    猜你喜欢
    • 2020-07-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-25
    • 2021-10-24
    • 1970-01-01
    • 2014-03-11
    • 1970-01-01
    相关资源
    最近更新 更多