mysql_config not found when installing mysqldb python interface

前端 未结 30 1451
暗喜
暗喜 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:29

    So far, all solutions (Linux) require sudo or root rights to install . Here is a solution if you do not have root rights and without sudo. (no sudo apt install ...):

    1. Download the .deb file of the libmysqlclient-dev, e.g. from this mirror
    2. Navigate to the downloaded file and run dpkg -x libmysqlclient-dev_.deb . This will extract a folder called usr.
    3. Symlink ./usr/bin/mysql_config to somewhere that is found on your $PATH:

      ln -s `pwd` /usr/bin/mysql_config FOLDER_IN_YOUR_PATH

    4. It should now be able to find mysql_config

    Tested on Ubuntu 18.04.

提交回复
热议问题