mysql8的坑
plugin?caching_sha2_password could not be loaded
我在mac上用Sequel Pro連數(shù)據(jù)庫的時(shí)候,會(huì)報(bào)出以上錯(cuò)誤,這是應(yīng)為8.0.11把身份認(rèn)證插件改成了?caching_sha2_password?,而客戶端沒法使用此插件。
?
這是我們只要用命令行進(jìn)去mysql,然后執(zhí)行
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';然后重新加載下數(shù)據(jù)庫配置
FLUSH PRIVILEGES;這樣就可以用客戶端連接數(shù)據(jù)庫了。
如果你想徹底更換所有用戶身份認(rèn)證插件,可以修改my.cnf。在末尾增加一行
default_authentication_plugin=mysql_native_passwordVariable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER'
我在使用laravel框架執(zhí)行migrate命令時(shí),出現(xiàn)錯(cuò)誤
QLSTATE[42000]: Syntax error or access violation: 1231 Variable 'sql_mode' can't be set to the value of ' NO_AUTO_CREATE_USER '
是因?yàn)閙ysql在8.0版本中已經(jīng)移除了NO_AUTO_CREATE_USER?這個(gè)模式。
解決方案:只需要將?config/database.php?配置文件中mysql 的?strict?的值改為false即可!
?
轉(zhuǎn)載于:https://www.cnblogs.com/smzd/p/9894844.html
總結(jié)
- 上一篇: 小三角
- 下一篇: mapper同时添加数据只能添加一条_s