为 mariadb 10 Ubuntu 13.10 安装 mysqldb python 接口时找不到 mysql_config

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22949654/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 02:02:26  来源:igfitidea点击:

mysql_config not found when installing mysqldb python interface for mariadb 10 Ubuntu 13.10

pythonmysqlsqlalchemymysql-pythonmariadb

提问by dartdog

After I installed Mariadb 10 the Mysql workbench and JPDB client both connect and work fine so next step was get programming with Python (using SQLAlchemy) which seems to require MySQL-python so I went to update that and got: "mysql_config not found" I looked in the "usual places" and did not see a file...

在我安装了 Mariadb 10 之后,Mysql 工作台和 JPDB 客户端都连接并且工作正常,所以下一步是使用 Python(使用 SQLAlchemy)编程,这似乎需要 MySQL-python 所以我去更新并得到:“mysql_config not found”我在“常用位置”中查看并没有看到文件...

So I followed some ideas from an earlier question on SOand tried to install: apt-get install libmysqlclient-dev

所以我遵循了之前关于 SO 的问题的一些想法 并尝试安装:apt-get install libmysqlclient-dev

which got me to: The following packages have unmet dependencies: libmysqlclient-dev : Depends: libmysqlclient18 (= 5.5.35-0ubuntu0.13.10.2) but 10.0.10+maria-1~saucy is to be installed

这让我想到:以下软件包具有未满足的依赖项:libmysqlclient-dev:依赖项:libmysqlclient18 (= 5.5.35-0ubuntu0.13.10.2) 但要安装 10.0.10+maria-1~saucy

which kind of hits a brick wall for me

哪一种对我来说是一堵砖墙

采纳答案by dartdog

Found it! The case is that mariadb has a compatible package, if you have the ppa setup as in http://downloads.mariadb.org/. Just

找到了!情况是 mariadb 有一个兼容的包,如果你有http://downloads.mariadb.org/ 中的 ppa 设置。只是

sudo apt-get install libmariadbclient-dev

Thanks to http://data-matters.blogspot.com/2013/08/install-mysql-python-with-mariadb.htmlAfter this the mysql-pythoninstalls correctly

感谢http://data-matters.blogspot.com/2013/08/install-mysql-python-with-mariadb.html在此之后mysql-python安装正确

回答by anonymous

For Centos 7.0 install the following:

对于 Centos 7.0 安装以下内容:

yum install mariadb-devel

For Fedora 23+:

对于 Fedora 23+:

dnf install mariadb-devel

回答by Christian Jürges

There's NO solution on Ubuntu 16.04

在 Ubuntu 16.04 上没有解决方案

Doing:

正在做:

sudo ln -s /usr/bin/mariadb_config /usr/bin/mysql_config

Worked for me.

为我工作。

回答by Kenly

Install the following library:

安装以下库:

sudo apt-get install libmariadb-client-lgpl-dev  

And create a symbolic link named mysql_config:

并创建一个名为 的符号链接mysql_config

ln -s /usr/bin/mariadb_config /usr/bin/mysql_config

回答by Simha

For Debian Jessie:

对于 Debian 杰西:

sudo apt-get install libmariadb-client-lgpl-dev 
sudo ln -s /usr/bin/mariadb_config /usr/bin/mysql_config

回答by f0xik

On Ubuntu 17.04 the following worked for me

在 Ubuntu 17.04 上,以下对我有用

sudo apt-get install default-libmysqlclient-dev

回答by Dmitry Mottl

For Debian/Ubuntu PPA from https://downloads.mariadb.org/mariadb/repositories/

对于来自https://downloads.mariadb.org/mariadb/repositories/ 的Debian/Ubuntu PPA

for MariaDB 10.1: apt-get install libmariadbclient-dev
for MariaDB 10.2: apt-get install libmariadb-dev
for MariaDB 10.3: apt-get install libmariadb-dev-compat

对于 MariaDB 10.1:apt-get install libmariadbclient-dev
对于 MariaDB 10.2:apt-get install libmariadb-dev
对于 MariaDB 10.3:apt-get install libmariadb-dev-compat