QT 6.1编译mysql驱动 mingw 81

采用Mingw 81 编译QT Mysql 驱动

1.下载mysql,需要include和lib目录
2.打开QT源码下Src\qtbase\src\plugins\sqldrivers\mysql\mysql.pro
3.修改pro文件
注释QMAKE_USE
添加
DESTDIR = KaTeX parse error: Undefined control sequence: \mysql at position 26: …CLUDEPATH += D:\̲m̲y̲s̲q̲l̲-8.0.23-winx64\…shadowed($$PWD)/qtsqldrivers-config.pri)
5.编译debug和release版本,debug版本手工改名加d
6.qsqlmysql.dll,qsqlmysqld.dll拷贝到Qt\6.0.2\mingw81_64\plugins\sqldrivers目录
7.mysql安装目录下lib文件夹中libmysql.dll拷贝至Qt\6.0.2\mingw81_64\bin

你可能感兴趣的:(QT)