-Lprobes_mysql cannot be found when MySQLdb-python is installed.

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.