mysql_config not found when installing mysqldb python interface

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

    sudo apt-get install python-mysqldb

    Python 2.5? Sounds like you are using a very old version of Ubuntu Server (Hardy 8.04?) - please confirm which Linux version the server uses.

    python-mysql search on ubuntu package database

    Some additional info:

    From the README of mysql-python -

    Red Hat Linux .............

    MySQL-python is pre-packaged in Red Hat Linux 7.x and newer. This includes Fedora Core and Red Hat Enterprise Linux. You can also build your own RPM packages as described above.

    Debian GNU/Linux ................

    Packaged as python-mysqldb_::

    # apt-get install python-mysqldb
    

    Or use Synaptic.

    .. _python-mysqldb: http://packages.debian.org/python-mysqldb

    Ubuntu ......

    Same as with Debian.

    Footnote: If you really are using a server distribution older than Ubuntu 10.04 then you are out of official support, and should upgrade sooner rather than later.

提交回复
热议问题