1. 连接问题
数据库升级8.0之后,使用php连接数据库,可能会报一个错误
Authentication plugin 'caching_sha2_password' cannot be loaded
这是因为MySQL
账号认证方式的改变,由此前的 mysql_native_password
变成了 caching_sha2_password
。
解决方法:修改认证方式
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';
2. 账号授权问题
原来授权的时候
grant all privileges on text.* to 'test'@'%' identified by 'password';
MySQL8
grant all privileges on text.* to 'test'@'%'
3. date 字段零值问题
查看下sql model
select @@sql_mode
把date 零值相关的两个移除,添加到my.cnf
,重启。