mardi 13 septembre 2016

Updating MySQL database character set using Laravel

Is there a way to update a MySQL database character set using Laravel, perhaps the DB facade? I know I can just run the statement in something like MySQL Workbench, but I wanted to create a job that would run several updates to tables following the database update.

I wanted to run:

DB::statement("ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci");

But I'm getting an error:

SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll().

Is there a way I can accomplish what I'm trying to do or should I just run the statement separately from the job?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire