Yii Framework Forum: Can't Access To Module Generator Page Of Gii! - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Can't Access To Module Generator Page Of Gii! Rate Topic: -----

#1 User is offline   nanh trắng 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 14-July 13

Posted 14 July 2013 - 08:34 PM

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!
0

#2 User is offline   codesutra 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 596
  • Joined: 15-March 11
  • Location:India

Posted 14 July 2013 - 11:55 PM

Nothing seems to be wrong here with your configuration.Are you able to execute any query command in your project or not. If it is also creating problem then might be there is some mis-configuration in your xampp server. You should have to check it again.

This error is pointing that database is not selected for your given table name. But you have specified the database in your settings.Even though please check database again and also settings related to pdo on your xampp server.
CodeSutra
0

#3 User is offline   nanh trắng 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 14-July 13

Posted 31 July 2013 - 12:58 PM

Actually, I found where is my mistake. The configuration for database was wrong at the key of database name. It should be 'dbname', not 'db'.
So the Gii can run now.
Hope it's useful for you guys! Also thanks codesutra!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users