/usr/bin/ld: cannot find -lmariadb

一 问题描述

执行make编译的时候报错:

/usr/bin/ld: cannot find -lmariadb

collect2: error: ld returned 1 exit status

make[2]: *** [sysbench] Error 1

make[2]: Leaving directory `/opt/sysbench/src'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/opt/sysbench/src'

make: *** [all-recursive] Error 1

二 解决办法

卸载MariaDB-devel,改装mysql-community-devel,再重新编译。

rpm -ivh mysql-community-common-5.7.36-1.el7.x86_64.rpm

rpm -ivh mysql-community-libs-5.7.36-1.el7.x86_64.rpm

rpm -ivh mysql-community-devel-5.7.36-1.el7.x86_64.rpm

下载地址:

https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-common-5.7.36-1.el7.x86_64.rpm

https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-libs-5.7.36-1.el7.x86_64.rpm

https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-devel-5.7.36-1.el7.x86_64.rpm

你可能感兴趣的:(#,MairaDB错误集锦,0,LINUX学习,mariadb,linux)