python 连接mysql报错:mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password' is not support

前提:使用mysql.connector.connect() 连接mysql数据:

原因: 如果你的 MySQL 是 8.0 版本,密码插件验证方式发生了变化,早期版本为 mysql_native_password,8.0 版本为 caching_sha2_password,所以需要做些改变:

1. 先修改 my.ini 配置:

[mysqld]
default_authentication_plugin=mysql_native_password

重启mysql 服务;

步骤1修改完后如果还不行,执行第2步;

2.  安装:

python -m pip install MySQL-connector-python

步骤1、步骤2 后基本可以使用了,如果还不行,执行步骤3;

3.  按如下代码修改:

myDb = connector.connect(host="localhost",user="root",passwd="******",database="test",auth_plugin='mysql_native_password')

python 连接mysql报错:mysql.connector.errors.NotSupportedError: Authentication plugin ‘caching_sha2_passw相关推荐

  1. workman使用时,mysql报错 mysql gone away

    在使用workman的时候碰到两个问题 1.mysql报错  mysql gone away; 2.redis更新报错: 原因: 查看workman 手册得知,不要在主进程中初始化数据库.memcac ...

  2. python连接SQL报错:1366, Incorrect string value: '\\xF0\\x9F\\x98\\x81'

    问题描述:Python从百度地图抓取消息保存到MySQL数据中,对应数据库字段为varchar以及TEXT,字符编码utf-8.部分插入成功,部分插入失败,报错如下. error:1366, &quo ...

  3. python连接oracle报错dpi 1047_python连接Oracle的方式以及过程中遇到的问题

    一.库连接步骤 1.下载cx_Oracle模块 下载步骤 工具 pycharm :File--->右键setting--->找到Project Interpreter  -----> ...

  4. python连接oracle报错tns_Python3操作oracle数据库及遇到的报错

    首先下载及安装cx_Oracle: 下载地址:http://www.lfd.uci.edu/~gohlke/pythonlibs/ 安装:pip3.6 install E:\Python36\Scri ...

  5. python连接oracle报错DPI-1047

    pip install cx_Oracle python连接时报错: 报错信息:cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Or ...

  6. 命令行连接MySQL报错:mysql: [Warning] Using a password on the command line interface can be insecure

    该问题与下面的问题一样: Linux下MySQL命令行不能输入密码

  7. MySQL 报错MySQL server syntax to use near 'OPTION SQL_SELECT_LIMIT=DEFAULT'

    在hive的应用中,出现如下错误时You have an error in your SQL syntax; check the manual that corresponds to your MyS ...

  8. python连接oracle报错TNS,python连接oracle数据库报出 ORA-12541: TNS: 无监听程序

    答:方法一: 在oracle_home下找到lsnrctl.exe 输入 start 方法二 可能认不到实例名 在cmd下运行 set oracle_sid=自己数据库的实例名(大多数orcl) 网上 ...

  9. 【MySQL】MySQL 8 IDEA连接本地MySQL报错 Host DESKTOP-MISSMJIJ is not allowed to connect to this serv

    1.背景 在window10 下开发,MySQL 8 IDEA连接本地MySQL报错 MySQL 8 Host DESKTOP-MISSMJIJ is not allowed to connect t ...

最新文章

  1. Google揭露美国政府通过NSL索要用户资料
  2. android 自定义listpreference,java-Android,单击ListPreference项时显示对话框
  3. 关于NullPointerException
  4. 鸿蒙系统出来没有,呜呼哀哉!历尽艰辛研发出鸿蒙系统,却无厂商敢用
  5. PHP金额计算高精度函数
  6. python函数的传参要求_python中函数传参详解
  7. JDK中这些常用方法也有Bug
  8. 微小宝公众号排行榜_排行榜 | 山西省高校、高职中专微信公众号周数据排行榜...
  9. burpsuite小米手机抓包_使用burpsuite实现Android APP的HTTPS抓包
  10. GTK实现绘图功能(draw.c)
  11. u盘无媒体容量0无卷还能修吗_都2020年了,买新U盘没Type-C接口就过时了
  12. struts2(一) struts2入门
  13. Chapter 5. MPEG-4 Visual
  14. 【狂神说Redis】1NoSQL概述1-2什么是NoSQL
  15. 伺服驱动器cn1引脚定义_关于三菱驱动器CN1端口的接线-专业自动化论坛-中国工控网论坛...
  16. 接口可维可测;统一管理
  17. ecc6.0 oracle安装,SAP ECC v6.0 SR3 IDES Oracle 10.2.0.2 安装指南
  18. Flask+pywebview开发桌面应用实战记录
  19. Packettracer--计算机网络实验
  20. Opengl ES之PBO

热门文章

  1. 【Java 8 新特性】Java 8 时间接口示例:MonthDay、Month、OffsetDateTime 和 OffsetTime
  2. I2C总线时序以及ACK和NACK(NAK)
  3. 知识蒸馏——pytorch实现
  4. 基因相关性——字符串入门
  5. 9patch / NinePatch 详解及使用
  6. 数据库、MySQL基本知识
  7. Failure to find xxx in 中央仓库
  8. 基于51单片机的流水灯设计
  9. python用变量的值声明新的变量
  10. oh-my-zsh详细安装与主题插件配置