Problem To Create Tables In Mysql

Hi, I’m new in this forum and in Yii Framework, so I’m following the Jeffrey Winesett’s book, so I did like the book said to connect to MySQL and create the tables and everything goes right, but my problem is in my own app. I’m trying to create my first app in Yii, but at the moment of create table I have the next error:

Apply the above migrations? (yes|no) [no]:yes

*** applying m130508_175146_creacion_tabla_usuarios

> create table tbl_usuarios ...exception 'CDbException' with message 'CDbCom

mand failed to execute the SQL statement: CDbCommand failed to prepare the SQL s

tatement: SQLSTATE[HY000]: General error: 1 near "ENGINE": syntax error. The SQL

statement executed was: CREATE TABLE ‘tbl_usuarios’ (


    "nombre" varchar(255) NOT NULL,

    "correo" varchar(255) NOT NULL,

    "password" varchar(255) NOT NULL,

    "activo" INT(11) DEFAULT 1,

    "idempresa" INT(11) NOT NULL

) ENGINE=InnoDB’ in D:\Dropbox\www\EF30\yii\framework\db\CDbCommand.php:357

Stack trace:

The migration file’s code is:

class m130508_175146_creacion_tabla_usuarios extends CDbMigration


public function up()


        $columns = array(


            'nombre'=>'string NOT NULL',

            'correo'=>'string NOT NULL',

            'password'=>'string NOT NULL',

            'activo'=>'INT(11) DEFAULT 1',

            'idempresa'=>'INT(11) NOT NULL',




public function down()





// Use safeUp/safeDown to do migration with transaction

public function safeUp()



public function safeDown()





I hope someone can help me, my time is running and I really want to lear to use Yii Framework,

thanks in advanced

Hi All

I’ll find the solution, in fact, there was something I did not, you have to configure console.php to work with MySQL, same that you do in main.php file in dp component,