Showing results for 
Show  only  | Search instead for 
Did you mean: 

Codeigniter -> Unable to connect to your database server using the provided settings.

getting following error on browser.

A PHP Error was encountered Severity:

Warning Message: mysqli::real_connect(): (HY000/1044):


Access denied for user 'dbuserxxx'@'localhost' to database 'dbnamexxx'

Filename: mysqli/mysqli_driver.php Line Number: 201


see constant variables database.php


$db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'dbuserxxx', 'password' => 'dbpasswordxxx', 'database' => 'dbnamexxx', '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 );



Please help

Helper VI

@Fakhar does the DB exist? Does the user exist? Also, does the user have permissions on the DB?



If you find my replies helpful, give me a like or kudo 🙂
And if I solved your issue, mark it as solution 😄