安装蓝鲸智云执行./bk_install bkdata时报cannot find -lmysqlclient解决

异常如下:在这里插入图片描述

    gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/opt/py27/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
    gcc -pthread -shared build/temp.linux-x86_64-2.7/_mysql.o -L/usr/lib -lmysqlclient -lpthread -lm -lrt -ldl -o build/lib.linux-x86_64-2.7/_mysql.so
    /opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-linux/8/ld: cannot find -lmysqlclient
    collect2: error: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/data/bkce/.envs/bkdata-dataapi/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-uwyoHv/MySQL-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-IQ4VNe-record/install-record.txt --single-version-externally-managed --compile --install-headers /data/bkce/.envs/bkdata-dataapi/include/site/python2.7/MySQL-python" failed with error code 1 in /tmp/pip-build-uwyoHv/MySQL-python/
[192.168.100.203]20201014-101811 177   pip install (--no-cache-dir --no-index --find-links=/data/src/bkdata/support-files/pkgs) for bkdata-dataapi.  FAILED
[192.168.100.203]20201014-101811 47   Abort

解决方案:
这是由于缺少/usr/lib/缺少libmysqlclient.so导致,需要做一个链接

ln -s /usr/lib64/mysql/libmysqlclient.so /usr/lib/

确认结果:

[root@rbtnode1 install]# ls /usr/lib/ | grep mysql
libmysqlclient.so

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值