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 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵