Unix/Linux:
sudo apt-get install libmysqlclient-dev
- 5.6.3
$ cd ~/Applications/Qt/source/5.6.3/qtbase-opensource-src-5.6.3/src/plugins/sqldrivers/mysql
$ ~/Applications/Qt/5.6.3/bin/qmake "INCLUDEPATH+=/usr/include/mysql" "LIBS+=/usr/lib/x86_64-linux-gnu/libmysqlclient.so" mysql.pro
- 5.13.2
$ cd ~/Applications/Qt/source/5.13.2/qtbase-opensource-src-5.13.2/src/plugins/sqldrivers
$ ~/Applications/Qt/offical/5.13.2/5.13.2/gcc_64/bin/qmake sqldrivers.pro
$ cd mysql
$ ~/Applications/Qt/offical/5.13.2/5.13.2/gcc_64/bin/qmake "INCLUDEPATH+=/usr/include/mysql" "LIBS+=/usr/lib/x86_64-linux-gnu/libmysqlclient.so" mysql.pro
redhat 6.5
- 5.6.3
$ cd /opt/vking/Qt/source/5.6.3/qtbase-opensource-src-5.6.3/src/plugins/sqldrivers/mysql
$ /opt/vking/Qt/5.6.3/gcc_64/bin/qmake "INCLUDEPATH+=/home/vking/Studio/SDK/vendor/database/mysql" "LIBS+=/usr/lib64/mysql/libmysqlclient.so.16" mysql.pro
$ /opt/vking/app/Qt/5.6.3/gcc_64/bin/qmake "INCLUDEPATH+=/opt/vking/Studio/code/SDK/vendor/database/mysql" "LIBS+=/opt/vking/app/Qt/5.6.3/gcc_64/lib/libmysqlclient.so" mysql.pro
或者:
$ /opt/vking/app/Qt/5.6.3/gcc_64/bin/qmake "INCLUDEPATH+=/opt/vking/Studio/code/SDK/vendor/database/mysql" "LIBS+=/opt/vking/Studio/code/SDK/vendor/database/mysql/lib_runtime64/libmysqlclient.so" mysql.pro
macOS
https://downloads.mysql.com/archives/get/p/23/file/mysql-8.0.25-macos11-x86_64.dmg
https://downloads.mysql.com/archives/get/p/23/file/mysql-8.0.28-macos11-x86_64.dmg
https://downloads.mysql.com/archives/get/p/23/file/mysql-8.0.31-macos12-x86_64.dmg
https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.32-macos13-x86_64.dmg
~/Qt/5.15.2/clang_64/bin/qmake "INCLUDEPATH+=/usr/local/mysql-8.0.25-macos11-x86_64/include" "LIBS+=/usr/local/mysql-8.0.25-macos11-x86_64/lib/libmysqlclient.dylib” mysql.pro
~/Qt/5.15.2/clang_64/bin/qmake "INCLUDEPATH+=/usr/local/mysql-8.0.32-macos13-x86_64/include" "LIBS+=/usr/local/mysql-8.0.32-macos13-x86_64/lib/libmysqlclient.dylib" mysql.pro
image.pngWindows:
mysql 下载地址:
https://cdn.mysql.com//archives/mysql-5.6/mysql-5.6.42-winx64.zip
https://cdn.mysql.com//archives/mysql-5.6/mysql-5.6.42-win32.zip
5.13.2
cd C:\Qt\source\qtbase-everywhere-src-5.13.2\src\plugins\sqldrivers\mysql
qmake "INCLUDEPATH+=D:\app\mysql\mysql-5.6.42-winx64\include" "LIBS+=D:\app\mysql\mysql-5.6.42-winx64\lib\libmysql.lib" -o Makefile mysql.pro
image.png编辑 mysql.pro
image.png再次运行,即可成功生成 Makefile
运行: mingw32-make
mingw32-make install
网友评论