在laravel5.1中执行:

\DB::connection('mysql2')
->statement('CREATE EVENT test ON SCHEDULE AT \'2015-12-03 17:37:35\' DO UPDATE product_id_mapped SET `status`=1 WHERE id=4;');


在数据库创建一个事件,直接报错:

SQLSTATE[HY000]: General error: 2030 This command is not supported in the prepared statement

PDO不支持的sql执行方式,后来多番查询找到解决方法:

\DB::connection('mysql2')
->unprepared('CREATE EVENT test ON SCHEDULE AT \'2015-12-03 17:37:35\' DO UPDATE product_id_mapped SET `status`=1 WHERE id=4;');

利用

DB::unprepared();

这个方法解决