python - NameError: name '_mysql' is not defined after ...
stackoverflow.com › questions › 63109987Jul 27, 2020 · Since Python3 is not able to connect with Python through mysqldb, you need to install an additional module to fix things. installing mysqlclient caused me to have the same NameError: : name '_mysql' is not defined problem. However, by using pymysql, and adding the code line pymysql.install_as_MySQLdb() at the top of my Flask app, I managed to get it running without any errors!