• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

mysql迁移至8.0时的注意事项(小结)

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

密码模式

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内容请搜索极客世界以前的文章或继续浏览下面的相关文章希望大家以后多多支持极客世界!


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Excel导入oracle的几种方法发布时间:2022-02-08
下一篇:
PostgreSQL模糊匹配走索引的操作发布时间:2022-02-08
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap