You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@thecodemonkey86 thanks to thecodemonkey86, I compile it in qt 6.6.1 successfully, this is my note.Hope can help you.
By the way, i install mysql8 on my windows 11.
Copy mysql lib path and head path to other dir. Because I got some errors like Permission denied or No such file or directory ,so change it in a simple path.
复制 mysql 头文件和 lib 库到一个简单目录,避免玄学问题。
C:\Program Files\MySQL\MySQL Server 8.0\include -> D:\mysql\include
C:\Program Files\MySQL\MySQL Server 8.0\lib -> D:\mysql\lib
Copy driver from C:\Program Files (x86)\QSQLiteDriverPlugins\plugins\sqldrivers to D:\Qt\6.6.1\mingw_64\plugins\sqldrivers
复制 qsqlmysql 驱动到 qt 插件目录。
Try to print all QSqlDatabase::drivers , But i found it is empty, and using ChatGpt, it tells me i need set plugins path.
打印看看是否有 mysql 驱动,如果找不到,把目录加进去,
@thecodemonkey86 thanks to thecodemonkey86, I compile it in qt 6.6.1 successfully, this is my note.Hope can help you.
By the way, i install mysql8 on my windows 11.
Permission denied
orNo such file or directory
,so change it in a simple path.复制 mysql 头文件和 lib 库到一个简单目录,避免玄学问题。
cmake --build build --target install
.使用 cmake-gui 和 cmake 命令
cmake --build build --target install
构建 qmysql.dll。C:\Program Files (x86)\QSQLiteDriverPlugins\plugins\sqldrivers
toD:\Qt\6.6.1\mingw_64\plugins\sqldrivers
复制 qsqlmysql 驱动到 qt 插件目录。
QSqlDatabase::drivers
, But i found it is empty, and using ChatGpt, it tells me i need set plugins path.打印看看是否有 mysql 驱动,如果找不到,把目录加进去,
6. Copy
qsqlmysql.dll
to project build path likebuild-opcTrans-Desktop_Qt_6_6_1_MinGW_64_bit-Release\sqldrivers
.复制
qsqlmysql.dll
到 exe 输出目录下sqldrivers
目录,没有建一个。7. Copy
libmysql.dll
to project build path likebuild-opcTrans-Desktop_Qt_6_6_1_MinGW_64_bit-Release
.复制
libmysql.dll
到 exe 输出目录下。8. Try to connect db.
然后就可以试试了。
Here are
libmysql.dll
。我自己编译的文件。libmysql.zip
qsqlmysql.dll
sqldrivers.zip
The text was updated successfully, but these errors were encountered: