Hi All,
I got the error "Error 500 CDbCommand failed to execute the SQL statement: SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected" when I tried to access to the Model generator page of GII.
Actually, I don’t know why, please kindly share the solution for the error!
Please refer some configurations below:
'modules'=>array(
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'123456',
'ipFilters'=>array('127.0.0.1','::1'),
),
),
'db'=>array(
'class'=>'CDbConnection',
'connectionString'=>'mysql:host=localhost;db=test',
'username'=>'root',
'password'=>'',
'emulatePrepare'=>true,
'charset'=>'utf8',
'active'=>true,
),
;extension=php_mbstring.dll
;extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
I’m using:
1-OS: window 7
2-Web server: xampp 3.2.1
3-browser: chrome
4-Yii: 1.1.13
Thanks in advance!