hcymysql / pt-slave-repair

自动修复MySQL主从同步数据
33 stars 10 forks source link

连接mysql 8.0.36异常 #4

Open yuanrui opened 4 months ago

yuanrui commented 4 months ago

异常提示如下:

Traceback (most recent call last):
  File "pt-slave-repair.py", line 77, in <module>
  File "check_repl_mysql.py", line 13, in __init__
  File "pymysql/connections.py", line 358, in __init__
  File "pymysql/connections.py", line 664, in connect
  File "pymysql/connections.py", line 976, in _request_authentication
  File "pymysql/_auth.py", line 266, in caching_sha2_password_auth
  File "pymysql/_auth.py", line 143, in sha2_rsa_encrypt
RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods
[2585] Failed to execute script 'pt-slave-repair' due to unhandled exception!
hcymysql commented 4 months ago

8.0用户认证模式发送了变化,需要在my.cnf里写死: default_authentication_plugin=mysql_native_password

采用5.7的传统认证模式即可。

ALTER USER 'repl'@'%' IDENTIFIED WITH mysql_native_password BY '123456';