CodeIgniter Forums

Full Version: Codeigniter database connection error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a database error so guys can you all help me overcome this problem.

this is my database.php file

$active_group = 'default';
$query_builder = TRUE;

$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'electroshop',
'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 I have inserted a image of my error also please look into it all give and answer.
And I'm using the codeigniter version 3.1.8
And I'm using the php version 7.2.5  

please guys help me find the problem.
@Heshan Make sure database 'electroshop' does exists in your database.
Also make sure that you start the MySQL Server.