Yii Framework Forum: Mysql Console Problem - Yii Framework Forum

Jump to content

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

Mysql Console Problem driver path issue?

#1 User is offline   haosmark 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 35
  • Joined: 27-January 13

Posted 28 January 2013 - 11:29 PM

I can't get yiic to connect to mysql (MySql works fine in browser).
This is the error that I'm getting:

Quote

exception 'CDbException' with message 'CDbConnection failed to open the DB conne
ction: could not find driver' in C:\xampp\htdocs\yii\framework\db\CDbConnection.
php:381

This is what my MySql section in console.php is like (uncommented):
'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=trackstar',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
		),


I'm using a jdbc driver and it's stored in my project directory:
C:\xampp\htdocs\trackstar\mysql-connector-java-5.1.22-bin.jar

How do I point it to yiic?

Here's a complete log:

Quote

2013/01/28 23:57:23 [error] [exception.CDbException] exception 'CDbException' with message 'CDbConnection failed to open the DB connection: could not find driver' in C:\xampp\htdocs\yii\framework\db\CDbConnection.php:381
Stack trace:
#0 C:\xampp\htdocs\yii\framework\db\CDbConnection.php(330): CDbConnection->open()
#1 C:\xampp\htdocs\yii\framework\db\CDbConnection.php(308): CDbConnection->setActive(true)
#2 C:\xampp\htdocs\yii\framework\base\CModule.php(387): CDbConnection->init()
#3 C:\xampp\htdocs\yii\framework\cli\commands\MigrateCommand.php(442): CModule->getComponent('db')
#4 C:\xampp\htdocs\yii\framework\cli\commands\MigrateCommand.php(451): MigrateCommand->getDbConnection()
#5 C:\xampp\htdocs\yii\framework\cli\commands\MigrateCommand.php(482): MigrateCommand->getMigrationHistory(-1)
#6 C:\xampp\htdocs\yii\framework\cli\commands\MigrateCommand.php(84): MigrateCommand->getNewMigrations()
#7 [internal function]: MigrateCommand->actionUp(Array)
#8 C:\xampp\htdocs\yii\framework\console\CConsoleCommand.php(172): ReflectionMethod->invokeArgs(Object(MigrateCommand), Array)
#9 C:\xampp\htdocs\yii\framework\console\CConsoleCommandRunner.php(67): CConsoleCommand->run(Array)
#10 C:\xampp\htdocs\yii\framework\console\CConsoleApplication.php(91): CConsoleCommandRunner->run(Array)
#11 C:\xampp\htdocs\yii\framework\base\CApplication.php(169): CConsoleApplication->processRequest()
#12 C:\xampp\htdocs\yii\framework\yiic.php(33): CApplication->run()
#13 C:\xampp\htdocs\trackstar\protected\yiic.php(7): require_once('C:\xampp\htdocs...')
#14 {main}
---

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