Let python 3 support the mysqldb solution, pythonmysqldb
Preface
In the new year, I wish you all use ES6 at the front end, PHP7 for php, JAVA9 for Java, and 3 for python. Now, the main content of this article is as follows. You may have used mysqldb in python2.x, but this component is not supported in python3.x. What if I want python 3 to support mysqldb? Let's take a look.
Cause
MySQLdb is only applicable to python2.x, and pip cannot be installed. Its alternatives in py3 are:Import pymysql
Pip install pymysqldjango + mysql
By default, Django still uses MySQLdb: The execution reports:ImportError: No module named 'mysqldb'
Solution:
In_ Init _. pyFile
Import pymysqlpymysql. install_as_MySQLdb ()
Summary
The above is all the content of this article. I hope the content of this article will help you in your study or work. If you have any questions, please leave a message, thank you for your support.