In the company development needs, to install the Python mysqldb under Linux. Found the way to install the installation is really painful, but also see the world, various problems ...
1. Fastest and simplest method (in time)
sudo yum install Mysql-python
You may encounter a problem:
>>> Import MySQLdb
Traceback (most recent):
File "<stdin>", line 1, in?
File "mysqldb/__init__.py", line A, in?
Raise Importerror ("This was MySQLdb version%s, but _mysql is version%r"%
Importerror:this is MySQLdb version (1, 2, 3, ' final ', 0), but _mysql is version (1, 2, 1, ' final ', 1)
Cause: Previously installed using the compiled method, the next is 1.2.3, but with Yum currently the highest 1.2.1, the conflict
Workaround: Delete the files that have been compiled
RM-RF mysql-python-1.2.3/
Then proceed
>>> Import MySQLdb
No error, it means success.
Python mysqldb fast installation under Linux