当前位置: 首页 > news >正文

Navicat连接mysql8.0:提示无法加载身份验证插件“caching_sha2_password”

Navicat连接mysql时,提示:Unable to load authentication plugin ‘caching_sha2_password‘.

原因:mysql 8.0 默认使用 caching_sha2_password 身份验证机制。
在这里插入图片描述

D:\MySQL8.0\install\bin>mysql -uroot -p123456789   #登录
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 22
Server version: 8.0.32 MySQL Community Server - GPLCopyright (c) 2000, 2023, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> use mysql
Database changed
mysql> select user,host,plugin,authentication_string from user;    #查看用户信息

在这里插入图片描述

修改身份验证机制

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';    #修改身份验证机制

更改过程:

mysql> mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';    #修改身份验证机制
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '4' at line 1
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
Query OK, 0 rows affected (0.07 sec)mysql> ALTER USER 'pokes'@'%' IDENTIFIED WITH mysql_native_password BY '123456';   #修改身份验证机制 
Query OK, 0 rows affected (0.06 sec)mysql>

MYSQL8.0开启远程链接

mysql -uroot -p123456
grant all privileges on *.* to 'root'@'%'identified by 'youpassword' with grant option;  #开启远程访问
mysql> CREATE USER 'pokes'@'%' IDENTIFIED BY '123456';		#新建一个用户
mysql> GRANT ALL PRIVILEGES ON *.* TO 'pokes'@'%' WITH GRANT OPTION;   #授权
mysql> FLUSH PRIVILEGES;    #刷新
D:\MySQL8.0\install\bin>mysql -uroot -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 8.0.32 MySQL Community Server - GPLCopyright (c) 2000, 2023, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> grant all privileges on *.* to 'root'@'%'identified by 'youpassword' with grant option;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'youpassword' with grant option' at line 1
mysql> CREATE USER 'pokes'@'%' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.63 sec)mysql> GRANT ALL PRIVILEGES ON *.* TO 'pokes'@'%' WITH GRANT OPTION;
Query OK, 0 rows affected (0.06 sec)mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.08 sec)mysql>
![在这里插入图片描述](https://img-blog.csdnimg.cn/afbaa2a3499f4a3e847bd434e6aa1e72.png)
http://www.lryc.cn/news/160230.html

相关文章:

  • 手写签名到背景上合为1张图
  • 华为认证系统学习大纲及课程
  • 某米ax3000路由器组网解析
  • 【leetcode 力扣刷题】数学题之除法:哈希表解决商的循环节➕快速乘求解商
  • Union类型和集合的union()方法-set.union()
  • 简明SQL别名指南:掌握AS实现列名更名
  • 基于量子密钥分发和区块链技术的新一代加密通信系统
  • 网络安全-子域名收集
  • go-zero jwt 鉴权快速实战
  • 9.8day58 单调栈
  • 快速完成工信部APP备案流程_以阿里云APP备案为例
  • uniapp中UView中 u-form表单在v-for循环下如何进行表单校验
  • 工作新时代,腾讯轻联塑造高效办公未来
  • JavaScript实现广告倒计时和跳过广告
  • 蚂蚁发布金融大模型:两大应用产品支小宝2.0、支小助将在完成备案后
  • Jenkins 持续集成:Linux 系统 两台机器互相免密登录
  • Golang-GJSON 快速而简单的方法来从 json 文档获取值
  • echarts根据x轴数据长度判断是否倾斜展示/柱状图上方显示数字
  • Eviews用向量自回归模型VAR实证分析公路交通通车里程与经济发展GDP协整关系时间序列数据和脉冲响应可视化...
  • 群晖NAS:通过Docker 部署宝塔面板【注册表:cyberbolt/baota】
  • pdfjs在线预览组件的使用
  • python线程、协程
  • AttributeError: module ‘OpenSSL.SSL’ has no attribute ‘SSLv3_METHOD
  • DTCC 2023丨云原生环境下,需要什么样的 ETL 方案?
  • 在UE4虚幻引擎中加入导航网格体边界体积后丧尸不能移动和发现玩家
  • 华为数通方向HCIP-DataCom H12-821题库(单选题:221-240)
  • aarch64 arm64 部署 stable diffusion webui 笔记 【1】准备 venv 安装pytorch 验证cuda
  • 从方法到目标了解什么是机器学习?
  • Devos勒索病毒:网络安全的新威胁,勒索病毒解密,数据恢复
  • go语言的高级特性