Search code examples
mysqldjangowindowscygwinvirtualenv

Installing mysql-python inside cygwin - mysql_config not found [Windows 7]


I'm trying to install mysql-python for use with Django, but receive the following error:

  File "setup_posix.py", line 25, in mysql_config
    raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found

I've seen other questions say this is due to it not being in the path. My path looks like this:

/cygdrive/c/Users/ddnm/Documents/skincare/skincare/bin:/home/ddnm/bin:/usr/local/bin:/home/ddnm/.local/bin:/usr/local/bin:/usr/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/cygdrive/c/Users/ddnm/.babun:/cygdrive/c/Python27:/cygdrive/c/Python27/Lib:/cygdrive/c/Python27/DLLs:/cygdrive/c/Python27/Lib/lib-tk:/cygdrive/c/Program Files/MySQL/MySQL Server 5.7/bin

In particular, I believe the problem is that mysql_config for Windows is a perl script, so the following is confusing cygwin:

master » which mysql_config    
mysql_config not found
master » which mysql_config.pl
/cygdrive/c/Program Files/MySQL/MySQL Server 5.7/bin/mysql_config.pl

Any suggestions/thoughts? Thanks


Solution

  • You can not mix cygwin programming with non cygwin program.
    To find in which package is mysql_config you can use:

    $ cygcheck -p mysql_config
    Found 15 matches for mysql_config
    libmysqlclient-devel-10.1.18-1 - libmysqlclient-devel: MariaDB/MySQL database client library (development) (installed binaries and support files)
    libmysqlclient-devel-10.1.19-1 - libmysqlclient-devel: MariaDB/MySQL database client library (development) (installed binaries and support files)
    libmysqlclient-devel-10.1.26-1 - libmysqlclient-devel: MariaDB/MySQL database client library (development)
    .....
    

    so you need to install libmysqlclient-devel.