Install MySQL Python to Centos6.4 - wxgwin/MyDocument GitHub Wiki
-
Download MySQL-python source file to local from web http://downloads.sourceforge.net/project/mysql-python/mysql-python-test/1.2.3c1/MySQL-python-1.2.3c1.tar.gz?use_mirror=nchc
-
Extract compress file
tar zxvf MySQL-python*
-
Install MySQL-python file
python setup.py install
-
After installing , you will found egg file in site-packages/MySQL_python-1.2.3c1-py2.6-linux-i686.egg
-
If got "_mysql.c:36:23: error: my_config.h: No such file or directory _mysql.c:38:19: error: mysql.h: No such file or directory _mysql.c:39:26: error: mysqld_error.h: No such file or directory" on installing ,
There are 2 solution.
- We need to modify file "site.cfg" in source folder , set correct value to variable "mysql_config", just like "mysql_config = /usr/bin/mysql_config"
- Maybe we need install mysql-devel, inpout command line "yum -y install mysql-devel.i686"
-
After step 5, Execute command "python setup.py build" Then, command "python setup.py install"