Skip to content
  • 0 Votes
    4 Posts
    2k Views
    Christian EhrlicherC

    Then please mark this topic as solved, thx.

  • 0 Votes
    16 Posts
    2k Views
    SGaistS

    One thing you can try is to use the "-I" and "-L" options of the configure script passing there the paths to your MySQL include and library folder.

  • 0 Votes
    8 Posts
    3k Views
    M

    @islam-ouahouda Try this, http://seppemagiels.com/blog/create-mysql-driver-qt5-windows it worked for me

  • 0 Votes
    7 Posts
    4k Views
    S

    @mchinand finally its work , you can't imagine how much you help me
    Thank you soooooooooo much :)

  • 0 Votes
    2 Posts
    3k Views
    S

    @swankster
    Solution was, finding this gem https://github.com/kivy/kivy/wiki/Creating-a-64-bit-development-environment-with-MinGW-on-Windows then making a few modifications. Basically rebuilding MySQL Connector.C 6.1\lib\libmysql.dll with gendef.exe
    will need to Install Ruby x64, I used (rubyinstaller-2.2.2-x64.exe)
    set Ruby...\bin to System Variables.
    copy C:\Program Files\MySQL\MySQL Connector.C 6.1 to C: and rename as \mysql-connector
    open cmd window
    C:\mysql-connector\lib
    > gendef.exe libmysql.dll
    > dlltool -v --dllname libmysql.dll --def libmysql.def --output-lib libmysql.lib
    > gem install mysql2 --no-rdoc --no-ri -- '--with-mysql-lib="C:\mysql-connector\lib" --with-mysql-include="C:\mysql-connector\include"'

    copy c:\mysql-connector\lib\libmysql.lib
    to c:\Program Files\MySQL\MySQL Server 5.6\lib

    copy c:\Ruby22-x64\lib\ruby\gems\2.2.0\gems\mysql2-0.3.18-x64-mingw32\vendor\libmysql.dll
    to c:\Program Files\MySQL\MySQL Server 5.6\lib

    Now build MySql Driver for QT. I used third party QT 64 from http://www.tver-soft.org/qt64
    put in System Variables
    C:\Qt\5.4.1-x64\mingw492r1-sjlj-rev1\qt-5.4.1-x64-mingw492r1-sjlj-rev1\bin;
    C:\Qt\5.4.1-x64\mingw492r1-sjlj-rev1\mingw64\bin;
    C:\Qt\5.4.1-x64\mingw492r1-sjlj-rev1\mingw64\lib
    Create QT cmd window (needs custom qtenv.bat file, copied from other QT version and modified for x64)
    from QT cmd x64

    set mysql=C:\PROGRA~1\MySQL\MYSQLS~1.6 (must be short names)
    cd c:\Qt\qt-5.4.1-src\qtbase\src\plugins\sqldrivers\mysql
    qmake "INCLUDEPATH+=%mysql%\include" "LIBS+=%mysql%\lib\libmysql.lib" -o Makefile mysql.pro
    mingw32-make

    copy qsqlmysql.dll and qsqlmysqld.dll from C:\Qt\qt-5.4.1-src\qtbase\plugins\sqldrivers to c:\Qt\5.4.1-x64\mingw492r1-sjlj-rev1\qt-5.4.1-x64-mingw492r1-sjlj-rev1\plugins\sqldrivers

    copy %mysql%\lib\libmysql.dll c:\windows

    Hope this helps someone else save a few days worth of time and aggravation.