Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default laravel's strict mode isn't compatible with MySQL 8.0 (NO_AUTO_CREATE_USERS) #23970

Closed
nickaguilarh opened this issue Apr 22, 2018 · 1 comment

Comments

@nickaguilarh
Copy link

  • Laravel Version: 5.6.6
  • PHP Version: 7.2
  • Database Driver & Version: MySQL 8.0

Description:

MySQL 8.0 removed "NO_AUTO_CREATE_USERS" mode, since it would be unnecessary because now we can't creare a user with GRANT, we must use CREATE USER.

This removal causes that, if we have strict mode enabled on database.php throw an error:
ERROR 1231 (42000):Variable 'character_set_client' can't be set to the value of 'NO_AUTO_CREATE_USERS'

Possible Solution:
Remove 'NO_AUTO_CREATE_USERS' from
/** * Get the query to enable strict mode. * * @return string */ protected function strictMode() { return "set session sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'"; }
on MySQLConnector.php:171

I'm resolving this issue setting mysql model manually on database.php

Steps To Reproduce:

Use a MySQL 8.0 database and do: php artisan migrate

@ntzm
Copy link
Contributor

ntzm commented Apr 22, 2018

Try this? #23961 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants