dongsou0083 2017-07-21 10:07
浏览 141
已采纳

Codeigniter:发生数据库错误无法使用提供的设置连接到数据库服务器

I have this new error when i added a new project in htdoc file of xampp and when I run it the is giving me the database error occurred here is my database file

$active_group = 'default';
$query_builder = TRUE;

$db['default'] = array(
    'dsn'   => '',
    'hostname' => 'localhost',
    'username' => 'root',  //ewfcbrhv_user
    'password' => 'sal123',  // aots123!321
    'database' => 'splendrz ',  //ewfcbrhv_aots
    '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
);

and it is giving me this error

Unable to connect to your database server using the provided settings.

Filename: E:/xampp/htdocs/aots/application/controllers/Home.php

Line Number: 8

kindly help as today is I am first day in the office and i'm stuck here on this error

  • 写回答

2条回答 默认 最新

  • doumou3883 2017-07-21 10:25
    关注

    Check the following -

    1. Is the password of your database entered in the config correct? ('sal123')?
    2. Does the database named - 'splendrz ' exist in your local mysql instance? Also, there seems to be a trailing space in this name. Most likely you need to remove that. ['splendrz'].
    3. If none of these work, check your error.log (apache error log) file for more clues.
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 加热反应炉PLC控制系统设计(相关搜索:梯形图)
  • ¥15 python 用Dorc包报错,我的写法和网上教的是一样的但是它显示无效参数,是什么问题
  • ¥15 经过滑动平均后的一维信号还原用什么结构好呢?
  • ¥15 指定IP电脑的访问设置
  • ¥30 matlab ode45 未发现警告,但是运行出错
  • ¥15 为什么devc++编译项目会失败啊
  • ¥15 vscode platformio
  • ¥15 代写uni代码,app唤醒
  • ¥15 全志t113i启动qt应用程序提示internal error
  • ¥15 ensp可以看看嘛.