[Solved] Invalid DB Driver in Codeigniter

Invalid DB Driver : Generally this issue comes when we make changes in system files or remove them accidentally. I also face same issue yesterday and i did a lot research about it and found three solutions that i am going to share with you.

Solution 1: MySQLi installation and configuration

Invalid DB Driver : Please make sure MySQLi Driver is installed and enabled in Apache. If it is not installed then install MySQLi for php and enable it in Apache.

Solution 2: Check System Directory of Codeigniter Project

Invalid DB Driver : Go to Go to system/database/driversand check mysqliand mysqldirectory exist at this location other get the files from fresh codeigniter and paste in to same directory.

Solution 3: Change The DB Driver from mysql to PDO

Go to application/config/database.phpand change the database driver mysqlito PDO and also change the dnswith proper arguments like pgsql:host=localhost;port=3306;dbname=myproject

$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
    'dsn'   => 'pgsql:host=localhost;port=3306;dbname=myproject',
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => '*******',
    'database' => 'myproject',
    'dbdriver' => 'pdo',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => FALSE,
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE

Hope this article is useful and solve your problem. If you still facing issue then join our community and ask your question there. You will get instant reply. You can also leave a comment here, I will be surely reply you.



Sill Facing issue ? You can hire a expert from Codeigniter Developers in minimum cost [Less then half hour work]

Note :This solution is for codeigniter 3.0 – Framework of PHP Programming Language.

About Amit Kumar

I am Amit, I am software engineer with 10 Years of experience. I am a blogger and affiliate marketer.

View all posts by Amit Kumar →