I've just installed MySQL 8.0.11
, transfered my app's database into it and changed the laravel database settings to use the new one. Now everytime I try to login I get the following error:
ERROR 1231 (42000):
Variable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER'
I tried to set NO_AUTO_CREATE_USER
manually:
set global sql_mode="..., NO_AUTO_CREATE_USER, ...";
But I get the same error. How could I solve the problem and run laravel 5.5
with MySQL 8.0.11
?
your laravel connexion (config / database.php) should be such that:
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
'modes' => [
'ONLY_FULL_GROUP_BY',
'STRICT_TRANS_TABLES',
'NO_ZERO_IN_DATE',
'NO_ZERO_DATE',
'ERROR_FOR_DIVISION_BY_ZERO',
'NO_ENGINE_SUBSTITUTION',
],
],
Add the following on each of your MySQL connections:
'modes' => [
'ONLY_FULL_GROUP_BY',
'STRICT_TRANS_TABLES',
'NO_ZERO_IN_DATE',
'NO_ZERO_DATE',
'ERROR_FOR_DIVISION_BY_ZERO',
'NO_ENGINE_SUBSTITUTION',
],
The next release of Laravel 5.5 will add support for MySQL 8.0: https://github.com/laravel/framework/pull/24038
UPDATE: Laravel 5.5.41 has been released.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With