qt android oci数据库,QT mysql SQLite 数据库支持

05c7dcae9a960c747d5baa6b0c643aa0.png

qt-opensource-linux-x64-5.14.1.run安装的qt可能只支持有限的几种数据库,缺少mysql的支持,按照下文操作添加mysql数据的支持。

操作

sudo apt-get install libmysqlclient-dev -y

export PATH=/opt/Qt5.14.1/5.14.1/gcc_64/bin/:$PATH

tar xf qt-everywhere-src-5.14.1.tar.xz

cd qt-everywhere-src-5.14.1/qtbase/src/plugins/sqldrivers

qmake

Running configuration tests...

Done running configuration tests.

Configure summary:

Qt Sql Drivers:

DB2 (IBM) .............................. no

InterBase .............................. no

MySql .................................. yes

OCI (Oracle) ........................... no

ODBC ................................... no

PostgreSQL ............................. no

SQLite2 ................................ no

SQLite ................................. yes

Using system provided SQLite ......... no

TDS (Sybase) ........................... no

Qt is now configured forbuilding. Just run "make".

Once everything is built, you must run "make install".

Qt will be installed into "/opt/Qt5.14.1/5.14.1/gcc_64".

Prior to reconfiguration, make sure you remove any leftovers from

the previous build.

make

sudo cp ./plugins/sqldrivers/libqsqlmysql.so /opt/Qt5.14.1/5.14.1/gcc_64/plugins/sqldrivers/

注意替换/opt/Qt5.14.1/5.14.1/的目录,我这里启用了mysql,其他的数据可以安装对应的启动也可以编辑,然后复制到对应的目录下。

重新运行程序。

I0225 20:50:21.861747   885 testSQL.cpp:40] open sucess

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值