在安装mysqldb Python的时候会用到mysql_config,但是正常安装的MySQL环境下是没有这个文件的,这个文件在Linux下是可执行文件,所以需要到mysql官方网站上下载MySQL-devel-5.1.50-1.glibc23.i386.rpm,然后用whereis mysql_config命令即可找到mysql_config文件啦
mysql_config在/usr/lib/mysql和/usr/bin下。
找不到mysql_config一般是由于通过lnmp.org或者其他方式安装mysql以后mysql_config是在/usr/local/mysql/bin/
里面,这里面的文件不是在任意位置都可以访问的
解决方法:
执行
ln -s /usr/local/mysql/bin/mysql_config /usr/local/bin/mysql_config
将mysql_config链接到/usr/local/bin
目录下
https://dev.mysql.com/doc/refman/5.7/en/mysql-config.html
mysql_config provides you with useful information for compiling your MySQL client and connecting it to MySQL. It is a shell script, so it is available only on Unix and Unix-like systems.
- --cflagsC Compiler flags to find include files and critical compiler flags and defines used when compiling the libmysqlclient library. The options returned are tied to the specific compiler that was used when the library was created and might clash with the settings for your own compiler. Use --include for more portable options that contain only include paths.
- --cxxflagsLike --cflags, but for C++ compiler flags.
- --includeCompiler options to find MySQL include files.
- --libsLibraries and options required to link with the MySQL client library.