Learning Python always encounter a variety of problems, a lot of problems I also Baidu for a long time, Google a lot, found that many people also encounter this problem;
Problem: The MySQL database is installed under the Windows System Python connection Error! What's going on?
Answer: Maybe a lot of answers are not the same if the error message mysql-python that you did not install this module with MySQL also need to install an ORM relationship mapping, the next chapter I will write another article!
Method One:
1. Install MySQL
First to the MySQL official website download files: Mysql-installer-community.msi installation process with the General EXE file, directly next;
2, Installation Mysql-python
Directly according to the link given by web.py, download the file mysql-python.tar.gz extract to any directory
Then install it under the cmd command line;
c:\...> python setup.py Install
c:\...> python setup.py bdist_wininst
Just double-click on the installation.
Method Two:
Sometimes we install Django and the environment is configured, but when we run our project, we will report such a mistake: No module named MySQL. One reason is that we didn't install MYSQLDB, which is Mysql-python
Installing Mysql-python under Windows is simple, just download the Windows installation to https://pypi.python.org/pypi/MySQL-python/1.2.4 here. or download here: http://sourceforge.net/projects/mysql-python/
The installation of Linux under MySQLdb is also very simple, we have spent a lot of time to introduce PIP. Installing MYSQLDB with PIP is also a command:
That's OK, if you don't have Pip, you can look back at this part's introduction to the PIP installation.
Basically i downloaded the connection on the file download and install the basic solution, I hope that my answer to you helpful! If you feel good, continue to pay attention, the latter will continue to write some useful articles!
Installation of Mysqldb/mysql-python under Windows