mysql_config not found when installing mysqldb python interface

前端 未结 30 1806
暗喜
暗喜 2020-11-22 06:56

I am trying to get a Python script to run on the linux server I\'m connected to via ssh. The script uses mysqldb. I have all the other components I need, but when I try to i

30条回答
  •  迷失自我
    2020-11-22 07:26

    This method is only for those who know that Mysql is installed but still mysql_config can't be find. This happens if python install can't find mysql_config in your system path, which mostly happens if you have done the installation via .dmg Mac Package or installed at some custom path. The easiest and documented way by MySqlDB is to change the site.cfg. Find the mysql_config which is probably in /usr/local/mysql/bin/ and change the variable namely mysql_config just like below and run the installation again. Don't forget to un-comment it by removing "#"

    Change below line

    "#mysql_config = /usr/local/bin/mysql_config"

    to

    "mysql_config = /usr/local/mysql/bin/mysql_config"

    depending upon the path in your system.

    By the way I used python install after changing the site.cfg

    sudo /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py install

提交回复
热议问题