如果我将dbdriver从mysqli更改为mysql它正在工作但不在mysqli中 会出现什么问题?
database.php - 数据库配置
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => '',
'password' => '',
'database' => '',
'dbdriver' => 'mysqli',
'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
);
答案 0 :(得分:0)
请确保在Apache中安装并启用了MySQLi驱动程序。
答案 1 :(得分:0)
为您提供三种解决方案
php-mysqli
并在apache中启用。将驱动程序从mysqli
切换到pdo
。
$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
);
您可以阅读参考文章中的完整教程。
https://mytechnode.com/invalid-db-driver-in-codeigniter-mysqli/