mysql迁移至8.0时的注意事项(小结)
密码模式
PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]
mysql8 之后,默认的密码模式改为 caching_sha2_password,新的模式需要新的驱动,至少现在 pdo / navicat 还没给出,所以我们还是得切换成老的 mysql_native_password 模式。
`mysql_native_password`:7.0 以下 `caching_sha2_password`:8.0 以上
1、my.cnf 配置默认的密码模式
[mysqld] default_authentication_plugin=mysql_native_password
2、更新账号的密码模式
# 创建新的账号 create user 'root'@'%' identified with mysql_native_password by '123456'; # 已存在的账号 alter user 'root'@'%' identified with mysql_native_password by '123456';
3、如果你需要授权
# 授权也不能兼并创建账号了,只能授权 grant all privileges on *.* to 'root'@'%' with grant option; flush privileges;
密码复杂度策略
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
密码复杂度验证策略导致的,关闭后设定即可
set global validate_password.policy=0; set global validate_password.length=6;
默认编码
PDO::__construct(): Server sent charset (255) unknown to the client. Please, report to the developers
设定 mysql 服务的默认编码
# Default Homebrew MySQL server config [client] default_character_set=utf8mb4 [mysql] default_character_set=utf8mb4 [mysqld] default_authentication_plugin=mysql_native_password character_set_server=utf8mb4 collation_server=utf8mb4_general_ci
远程访问
1、my.conf 注释掉本地监听
[mysqld] #bind_address=127.0.0.1
2、更新账号的 host
update mysql.user set host='%' where user='root';
到此这篇关于mysql迁移至8.0时的注意事项(小结)的文章就介绍到这了,更多相关mysql迁移至8.0内容请搜索狼蚁SEO以前的文章或继续浏览狼蚁网站SEO优化的相关文章希望大家以后多多支持狼蚁SEO!
编程语言
- socket网络编程 socket网络编程Socket基础
- 少儿编程培训班 少儿编程培训班教学方法
- linux系统编程:Linux系统编程多线程基础
- unix环境高级编程 首发于 UNIX环境高级编程学习之
- 学编程学哪一种比较好 初学者哪种编程语言比较
- 学PLC编程学费多少
- 计算机编程入门 学计算机编程入门的初学指南
- 世界编程语言排行榜
- vba编程培训:Excel VBA编程培训初学者教程
- 少儿编程课程:少儿编程学什么及各年龄段如何
- 游戏编程入门:少儿游戏编程入门的技巧
- 学编程哪个培训机构好 编程培训机构哪个好
- 编程机器人加盟 机器人编程加盟哪家好
- 在线少儿编程机构排名
- 电脑编程入门自学
- 服务器系统下载:服务器系统的安装