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条)

报告相同问题?