Kylin + Qt + mysql driven to solve the problem can not be loaded

Problem Description: Qt are installed, Mysql, and found Qt still can not connect Mysql

1, installed Qt

2, write the program directly connected QMysql

Print QSqlDatabase: * driver not loaded, enter ../Qt/gcc_64_/plug/sql/, I found so mysql, which is available to our dynamic Qt library, we passed this dynamic library CRUD database specific implementation , in this so called so Mysql in the ..

3, ldd Qt dynamic libraries

Found libmysqlclient.so.18 (QMysql of so) not found, there is no explanation Mysql environment

4, install Mysql dynamic library

I tried two ways:

Direct all installed Mysql, run the program prints mysql_server_init symbols are not, at this time has no print libmysqlclient.so.18 not found, I found a description of;

Installation mysql-devel, this print is not available packages,

1.yum -y install wget
2.wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
3. rpm -ivh mysql-community-release-el7-5.noarch.rpm
4.yum install mysql-devel

In case:

yum install mysql*

 

Guess you like

Origin www.cnblogs.com/judes/p/11788503.html