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

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 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败
  • ¥15 树莓派5怎么用camera module 3啊
  • ¥20 java在应用程序里获取不到扬声器设备
  • ¥15 echarts动画效果的问题,请帮我添加一个动画。不要机器人回答。
  • ¥15 Attention is all you need 的代码运行
  • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事: