修改protected/config/main.php

        'db'=>array(
            'connectionString' => 'mysql:host=localhost;dbname=test',
            'emulatePrepare' => true,
            'username' => 'root',
            'password' => 'root',
            'charset' => 'utf8',
                      /*
                       * 下面是调试信息,显示执行的数据库操作
                       */
                       'enableProfiling'=>YII_DEBUG, 
                      'enableParamLogging'=>YII_DEBUG,
        ),
'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				
				array(
					'class'=>'CWebLogRoute',
                                        'levels'=>'trace', 
                                        'categories'=>'system.db.*', 
				),
				
			),

  

相关文章:

  • 2021-12-06
  • 2021-09-17
  • 2021-10-26
  • 2021-06-02
  • 2021-09-05
  • 2022-12-23
  • 2021-10-22
  • 2022-01-18
猜你喜欢
  • 2022-12-23
  • 2021-12-23
  • 2021-05-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-31
相关资源
相似解决方案