Laravel接続MySQL 8.0.11出会ったいくつかの穴

1036 ワード

1. Authentication Type
多くの友达がmysqlで8.0アップグレードしていると信じています.11後、データベース接続に問題が発生していることがわかりました.
なぜなら、ユーザーのSQLSTATE[HY000] [2054] The server requested authentication method unknown to the clientのデフォルトはAuthentication typeであり、データベース接続エラーが発生し、caching_sha2_password解決方法:パスワード認証方式Illuminate\Database\QueryException : SQLSTATE[HY000] [2054] The server requested authentication method unknown to the clientを修正する
2、NO_を削除したAUTO_CREATE_USERモード
5.7.*のログには、8.0で廃止されたと記載されています.11で削除され、移行時に次の異常が放出されます:ALTER USER 'YOURUSERNAME'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YOURPASSWORD';ソリューション:Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1231 Variable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER'プロファイルのmysqlのconfig/database.phpの値をstrictに変更します.
転載元:https://laravel-china.org/articles/10736/some-craters-in-mysql-8011