Skip to content

Install MySQL Python to Centos6.4

wxgwin edited this page Nov 29, 2013 · 1 revision
  1. 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

  2. Extract compress file

    tar zxvf MySQL-python*

  3. Install MySQL-python file

    python setup.py install

  4. After installing , you will found egg file in site-packages/MySQL_python-1.2.3c1-py2.6-linux-i686.egg

  5. 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.

    1. 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"
    2. Maybe we need install mysql-devel, inpout command line "yum -y install mysql-devel.i686"
  6. After step 5, Execute command "python setup.py build" Then, command "python setup.py install"

Clone this wiki locally