When installing MySQLdb-python, you cannot find-lprobes_mysql to process a python
BitsCN.com
-Lprobes_mysql cannot be found when MySQLdb-python is installed.
When installing MySQLdb, I have done the following:
1) configure mysql_config
There are two ways to do this:
① Make a soft connection and link mysql_config to/usr/local/bin.
② Modify the site. cfg configuration and point mysql_config to $ MYSQL_HOME/bin/mysql_config.
2) configure the dynamic link library: write $ MYSQL_HOME/mysql/lib to/etc/ld. so. conf, and then ldconfig generates the cache
I thought that when I was in arrears, I had to go through the gutter. execute: python setup. py install and report the following error:
[Plain]
Gcc-pthread-shared build/temp. linux-i686-2.7/_ mysql. o-L/home/mysql/lib-lmysqlclient-lpthread-lprobes_mysql-lz-lm-lrt-ldl-o build/lib. linux-i686-2.7/_ mysql. so
/Usr/bin/ld: cannot find-lprobes_mysql
Collect2: ld returns 1
Error: command 'gcc 'failed with exit status 1
For source code problems, use the Python package manager to install: pip install MySQLdb-python, but lprobes_mysql cannot be found.
Later I suspected it was a gcc problem. after all, there was "error: command 'gcc 'failed with exit status"
So I typed mysql-devel through the local yum source, and thought I could finally close my hand. Ah, the error persists !!
Return to the key point "/usr/bin/ld: cannot find-lprobes_mysql"
Careful analysis, we know that ld is a shared library loader, but I have done this in 2 ).
It is unreasonable that the ld cannot be found, unless there is only one possibility, that is, there is no such thing. how can we find the ld ??
Because my mysql is compiled and installed by source code, CMAKE does not specify the-DENABLE_DTRACE = OFF option [ON by default]
But I want to reinstall mysql ?? I can't do it...
Finally, I was inspired by a comment from a foreigner in bugs.mysql.com.
Remove-lprobes_mysql from the 112nd libs key value in mysql_config, and then run python setup. py install
Successful!
If your mysql instance is installed in binary or in rpm, this problem may not exist.
BitsCN.com