ubuntu下安装qt 的mysql 驱动遇到的问题

在Ubuntu系统中安装Qt并添加MySQL驱动时遇到困难,包括QMAKESPEC conf文件读取错误和找不到libqsqlmysql.so库。通过使用sudo apt-get install命令安装驱动,以及手动查找并复制动态库到正确位置,最终成功解决驱动问题并创建测试DEMO连接到MySQL数据库。
摘要由CSDN通过智能技术生成

参照网上教程,做的过程遇到很多问题,记下.


1.首先我将软件中心搜到的mysql server和客户端都装上了.


2.sudo apt-get install libmysqlclient18 libmysqlclient-dev libmysqld-dev


3.参照qt creater的帮助,搜sql可以找到database driver字样


How to Build the QMYSQL Plugin on Unix and Mac OS X
You need the MySQL header files and as well as the shared librarylibmysqlclient.so. Depending on your Linux distribution you may need to install a package which is usually called "mysql-devel".
Tell qmake where to find the MySQL header files and shared libraries (here it is assumed that MySQL is installed in /usr/local) and runmake:
评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值