Use pymysql to connect to the MySql database and report an error RuntimeError:
'cryptography' package is required for sha256_password or caching_sha2_password auth methods
The error message means: sha256_password and caching_sha2_password encryption methods require cryptography.
So just install the cryptography package:
pip install cryptography
After the installation is complete, execute it again, and it will be ok.