PyMySql常见错误

tech2025-07-16  2

错误1:

pymysql is not allowed to connect to this MySQL server

mysql -u root -p mysql>use mysql; mysql>select 'host' from user where user='root'; mysql>update user set host = '%' where user ='root'; mysql>flush privileges;

错误2:

pymql cryptography’ package is required for sha256_password or caching_sha2_password auth methods

解决办法:

这段报错意思是说 sha256_password 和 caching_sha2_password 这两个加密算法需要用到 cryptography 。因此该方法的解决方法就是pip install cryptography

参考文章1: 参考文章2:

最新回复(0)