Mac下mysql 安装了版本8.x版本后登入phpmyadmin的报错the server requested authentication method unknown to the client

一,在MySQL 8.0.11中,caching_sha2_password是默认的身份验证插件,而不是以往的mysql_native_password。有关此更改对服务器操作的影响以及服务器与客户端和连接器的兼容性的信息,请参阅caching_sha2_password作为首选的身份验证插件。(翻译自https://dev.mysql.com/doc/refman/8.0/en/caching-...
摘要由CSDN通过智能技术生成

一,在MySQL 8.0.11中,caching_sha2_password是默认的身份验证插件,而不是以往的mysql_native_password。有关此更改对服务器操作的影响以及服务器与客户端和连接器的兼容性的信息,请参阅caching_sha2_password作为首选的身份验证插件。(翻译自https://dev.mysql.com/doc/refman/8.0/en/caching-sha2-pluggable-authentication.html

 

今天在Mac 上配置安装mysql8.0.11时,设置mysql密码,设置成功后在终端下输入mysql -u root -p,再输入密码能正常进入,但在phpmyadmin提示无法连接,具体报错信息为:

mysqli_real_connect(): The server requested authentication method unknown to the client [sha256_password]

解决方法:在mysql的配置文件上添加一些代码:要在[mysqld]位置上。但在mac上找不到my.conf文件。只能自己手动添加:

将加密方式改为旧的,在配置文件my.conf中添加如下:

[mysqld]

default_authentication_plugin=mysql_native_password

my.conf具体内容为下:

# Example MySQL config file for small systems.  
#  
# This is for a system with little memory (<= 64M) where MySQL is only used  
# from time to time and it's important that the mysqld daemon  
# doesn't use much resources.  
#  
# MySQL programs look for option files in a set of  
# locations which depend on the deployment platform.  
# You can copy this option file to one of those  
# locations. For information about these locations, see:  
# http://dev.mysql.com/
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值