I have a WAMP server with the following credentials for the MySQL:
username: root
password: ''
But when I configure the $autoload['libraries'] = array('database');
, I get this error:
A PHP Error was encountered
Severity: Warning
Message: mysqli::real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO)
Filename: mysqli/mysqli_driver.php
Line Number: 202
Backtrace:
File: C:\wamp\www\ci\index.php
Line: 315
Function: require_once
A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: C:/wamp/www/ci/system/database/DB_driver.php
Line Number: 436
If I'm not mistaken, it is asking for a password in MySQL to which I did not put one. Below is the configuration at Codeigniter's database.php.
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'sandbox',
'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
Thank you for the help.