linux mysql-server can't find mysql_config

依然范特西╮ 提交于 2020-05-25 04:29:45

问题


I have a running (in production) mysql instance on my linux server (ubuntu-10.10) however I cannot find my mysql_config file.

command and output:

~$ locate mysql_config
~$

I've heard/read that I need the libmysqlclient-dev package installed to be able to use mysql_config but I don't want to break my current production instance. I want to make sure installing this dev package is not going to have adverse effects on my current mysql databases.

Furthermore, where can I find the source download for libmysqlclient-dev to install manually? In my current situation (behind corporate proxy) I am not permitted to use apt-get's.

UPDATE

this is stemming from attempting to install python-MySQLdb from source. the setup.py file is requiring the mysql_config path and continues to break when trying to use anything but that file.


回答1:


The mysql_config executable is by default located in the bin directory of the MySQL server installation if you install it from precompiled binaries. But if you install it using apt-get it may not exist on your server.

Try:

sudo apt-get install libmysqlclient-dev



回答2:


yum install mariadb-devel works for Centos 7 too, this puts the mysql_config into all the places that pip install mysqlclient requires/looks for it.




回答3:


In Ubuntu 13.04 installation, it is at /usr/bin/mysql_config




回答4:


Try /etc/my.cnf, that is the standard file for mysql config.




回答5:


You can also do:

find / -name my.cnf -type f



回答6:


On Fedora, install the mariadb-devel package, and you should have the binary.



来源:https://stackoverflow.com/questions/8496660/linux-mysql-server-cant-find-mysql-config

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!