Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

compiling mysql plugin qt documentation incomplete



  • Hi,

    during the last days I read a lot of threads about the mysql plugin problems and spent a lot of time, not in this forum only.

    Nothing helped and I followed the QT instructions from here:

    https://doc.qt.io/qt-5/sql-driver.html#how-to-build-the-qmysql-plugin-on-windows

    The connector installation and the qmake call worked fine. I had the same folders as the documentation.

    Next steps are:

    nmake sub-mysql
    nmake install
    

    The documentation says:
    If you are not using a Microsoft compiler, replace nmake with mingw32-make above.

    For me this is:

    mingw32-make sub-mysql
    mingw32-make install
    

    When i call mingw32-make sub-mysql it says:

    C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers>mingw32-make sub-mysql
    mingw32-make: *** No rule to make target 'sub-mysql'.  Stop.
    

    But when I use

    mingw32-make
    mingw32-make install
    

    It works. Just see the output.

    C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers>mingw32-make
    cd odbc\ && ( if not exist Makefile C:\Qt\5.14.2\mingw73_32\bin\qmake.exe -o Makefile C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\odbc\odbc.pro ) && mingw32-make -f Makefile
    mingw32-make[1]: Entering directory 'C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/odbc'
    mingw32-make -f Makefile.Release
    mingw32-make[2]: Entering directory 'C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/odbc'
    mingw32-make[2]: Nothing to be done for 'first'.
    mingw32-make[2]: Leaving directory 'C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/odbc'
    mingw32-make[1]: Leaving directory 'C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/odbc'
    cd sqlite\ && ( if not exist Makefile C:\Qt\5.14.2\mingw73_32\bin\qmake.exe -o Makefile C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\sqlite\sqlite.pro ) && mingw32-make -f Makefile
    mingw32-make[1]: Entering directory 'C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/sqlite'
    mingw32-make -f Makefile.Release
    mingw32-make[2]: Entering directory 'C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/sqlite'
    mingw32-make[2]: Nothing to be done for 'first'.
    mingw32-make[2]: Leaving directory 'C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/sqlite'
    mingw32-make[1]: Leaving directory 'C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/sqlite'
    
    C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers>mingw32-make install
    cd odbc\ && ( if not exist Makefile C:\Qt\5.14.2\mingw73_32\bin\qmake.exe -o Makefile C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\odbc\odbc.pro ) && mingw32-make -f Makefile install
    mingw32-make[1]: Entering directory 'C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/odbc'
    mingw32-make -f Makefile.Release install
    mingw32-make[2]: Entering directory 'C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/odbc'
    C:\Qt\5.14.2\mingw73_32\bin\qmake.exe -install qinstall C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\plugins\sqldrivers\qsqlodbc.dll.debug C:\Qt\5.14.2\mingw73_32\plugins\sqldrivers\qsqlodbc.dll.debug
    copy /y ..\plugins\sqldrivers\qsqlodbc.dll C:\Qt\5.14.2\mingw73_32\plugins\sqldrivers\qsqlodbc.dll
            1 Datei(en) kopiert.
    C:\Qt\5.14.2\mingw73_32\bin\qmake.exe -install qinstall C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\lib\cmake\Qt5Sql\Qt5Sql_QODBCDriverPlugin.cmake C:\Qt\5.14.2\mingw73_32\lib\cmake\Qt5Sql\Qt5Sql_QODBCDriverPlugin.cmake
    mingw32-make[2]: Leaving directory 'C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/odbc'
    mingw32-make[1]: Leaving directory 'C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/odbc'
    cd sqlite\ && ( if not exist Makefile C:\Qt\5.14.2\mingw73_32\bin\qmake.exe -o Makefile C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\sqlite\sqlite.pro ) && mingw32-make -f Makefile install
    mingw32-make[1]: Entering directory 'C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/sqlite'
    mingw32-make -f Makefile.Release install
    mingw32-make[2]: Entering directory 'C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/sqlite'
    C:\Qt\5.14.2\mingw73_32\bin\qmake.exe -install qinstall C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\plugins\sqldrivers\qsqlite.dll.debug C:\Qt\5.14.2\mingw73_32\plugins\sqldrivers\qsqlite.dll.debug
    copy /y ..\plugins\sqldrivers\qsqlite.dll C:\Qt\5.14.2\mingw73_32\plugins\sqldrivers\qsqlite.dll
            1 Datei(en) kopiert.
    C:\Qt\5.14.2\mingw73_32\bin\qmake.exe -install qinstall C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\lib\cmake\Qt5Sql\Qt5Sql_QSQLiteDriverPlugin.cmake C:\Qt\5.14.2\mingw73_32\lib\cmake\Qt5Sql\Qt5Sql_QSQLiteDriverPlugin.cmake
    mingw32-make[2]: Leaving directory 'C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/sqlite'
    mingw32-make[1]: Leaving directory 'C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/sqlite'
    
    C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers>
    

    The output only seems to do something with odbc and sqlite. That is why I am not sure if i was right with my compilations.

    The documentations says for the next step:

    When you distribute your application, remember to include libmysql.dll in your installation package. It must be placed in the same folder as the application executable. libmysql.dll additionally needs the MSVC runtime libraries which can be installed with vcredist.exe

    Where will I find the compiled libmysql.dll ? I find it anywhere and when I look at the output of mingw32-make I am not sure if mysql was compiled. Did I made anything wrong?



  • When running qmake, did you see the output?
    I think the result of "Checking for MySQL" probably was "no"...
    But I didn't figure out how to compile that, either.
    I ended up with using an older version of Qt 5.12.2 which comes with the mysql plugin.



  • try those steps

    mingw32-make clean
    mingw32-make distclean
    remove file manually (where C:\Qt\Qt5.14.1\5.14.1\Src\qtbase\src\plugins\sqldrivers): config, config.txt, config.opt, config.summary

    X86

    1. run Qt 5.14.1 (MinGW 7.3.0 32-bit)
    2. cd C:\Qt\Qt5.14.1\5.14.1\Src\qtbase\src\plugins\sqldrivers
    3. qmake -- MYSQL_INCDIR="C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" MYSQL_LIBDIR="C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/lib"
    4. make sure "MySql .................................. yes"
    5. mingw32-make
    6. mingw32-make install

    X64

    1. run Qt 5.14.1 (MinGW 7.3.0 64-bit)
    2. cd C:\Qt\Qt5.14.1\5.14.1\Src\qtbase\src\plugins\sqldrivers
    3. qmake -- MYSQL_INCDIR="C:/Program Files/MySQL/MySQL Server 8.0/include" MYSQL_LIBDIR="C:/Program Files/MySQL/MySQL Server 8.0/lib"
    4. make sure "MySql .................................. yes"
    5. mingw32-make
    6. mingw32-make install


  • Hi both,

    this here is my qmake.

    C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers>qmake -- MYSQL_INCDIR="C:/Program Files/MySQL/MySQL Connector C 6.1/include" MYSQL_LIBDIR="C:/Program Files/MySQL/MySQL Connector C 6.1/lib"
    Info: creating stash file C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\.qmake.stash
    
    Running configuration tests...
    Checking for DB2 (IBM)... no
    Checking for InterBase... no
    Checking for MySQL... no
    Checking for OCI (Oracle)... no
    Checking for ODBC... yes
    Checking for PostgreSQL... no
    Checking for SQLite (version 2)... no
    Checking for TDS (Sybase)... no
    Done running configuration tests.
    
    Configure summary:
    
    Qt Sql Drivers:
      DB2 (IBM) .............................. no
      InterBase .............................. no
      MySql .................................. no
      OCI (Oracle) ........................... no
      ODBC ................................... yes
      PostgreSQL ............................. no
      SQLite2 ................................ no
      SQLite ................................. yes
        Using system provided SQLite ......... no
      TDS (Sybase) ........................... no
    
    Qt is now configured for building. Just run 'mingw32-make'.
    Once everything is built, you must run 'mingw32-make install'.
    Qt will be installed into 'C:\Qt\5.14.2\mingw73_32'.
    
    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.
    

    I will get an no. Why ist that?


  • Lifetime Qt Champion

    @Philipp-DE said in compiling mysql plugin qt documentation incomplete:

    I will get an no. Why ist that?

    As mentioned in the documentation take a look in your config.log to see what went wrong:



  • Hi,

    it says mysql_config not found.

    Command line: "MYSQL_INCDIR=C:/Program Files/MySQL/MySQL Connector C 6.1/include" "MYSQL_LIBDIR=C:/Program Files/MySQL/MySQL Connector C 6.1/lib"
    Global lib dirs: [C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.7.25-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib] [C:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0 C:/Qt/Tools/mingw730_32/lib/gcc C:/Qt/Tools/mingw730_32/i686-w64-mingw32/lib C:/Qt/Tools/mingw730_32/lib]
    Global inc dirs: [C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.7.25-win32\\include C:\\Utils\\postgresql\\pgsql\\include] [C:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++ C:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/i686-w64-mingw32 C:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/backward C:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include C:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include-fixed C:/Qt/Tools/mingw730_32/i686-w64-mingw32/include]
    looking for library db2
    Trying source 0 (type inline) of library db2 ...
    sqlcli.h not found in [] and global paths.
    sqlcli1.h not found in [] and global paths.
      => source produced no result.
    Trying source 1 (type inline) of library db2 ...
      => source failed condition '!config.win32'.
    test config.sqldrivers.libraries.db2 FAILED
    looking for library ibase
    Trying source 0 (type inline) of library ibase ...
    ibase.h not found in [] and global paths.
      => source produced no result.
    Trying source 1 (type inline) of library ibase ...
      => source failed condition '!config.win32'.
    test config.sqldrivers.libraries.ibase FAILED
    looking for library mysql
    Trying source 0 (type mysqlConfig) of library mysql ...
    mysql_config not found.
      => source produced no result.
    Trying source 1 (type mysqlConfig) of library mysql ...
    mysql_config not found.
      => source produced no result.
    Trying source 2 (type mysqlConfig) of library mysql ...
    mysql_config not found.
      => source produced no result.
    Trying source 3 (type mysqlConfig) of library mysql ...
    mysql_config not found.
      => source produced no result.
    Trying source 4 (type inline) of library mysql ...
      => source failed condition '!config.win32'.
    Trying source 5 (type inline) of library mysql ...
    + cd /d C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\mysql && C:\Qt\5.14.2\mingw73_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.7.25-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.7.25-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "QMAKE_USE += mysql" "QMAKE_LIBS_MYSQL = \"-LC:/Program Files/MySQL/MySQL Connector C 6.1/lib\" -llibmysql" "QMAKE_INCDIR_MYSQL = \"C:/Program Files/MySQL/MySQL Connector C 6.1/include\"" C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql
    + cd /d C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\mysql && set MAKEFLAGS=& mingw32-make
    > g++ -c -fno-keep-inline-dllexport -O2 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.7.25-win32\include -IC:\Utils\postgresql\pgsql\include -I"C:\Program Files\MySQL\MySQL Connector C 6.1\include" -IC:\Qt\5.14.2\mingw73_32\mkspecs\win32-g++  -o main.o main.cpp
    > g++ -Wl,-s -Wl,-subsystem,console -mthreads -o mysql.exe main.o  -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.7.25-win32\lib -LC:\Utils\postgresql\pgsql\lib -L"C:\Program Files\MySQL\MySQL Connector C 6.1\lib" -llibmysql   
    > main.o:main.cpp:(.text.startup+0xc): undefined reference to `mysql_get_client_version@0'
    > collect2.exe: error: ld returned 1 exit status
    > mingw32-make: *** [Makefile:69: mysql.exe] Error 1
     => source failed verification.
    Trying source 6 (type inline) of library mysql ...
      => source failed condition '!config.win32'.
    test config.sqldrivers.libraries.mysql FAILED
    looking for library oci
    Trying source 0 (type inline) of library oci ...
    oci.h not found in [] and global paths.
      => source produced no result.
    Trying source 1 (type inline) of library oci ...
      => source failed condition '!config.win32'.
    test config.sqldrivers.libraries.oci FAILED
    looking for library odbc
    Trying source 0 (type inline) of library odbc ...
    + cd /d C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\odbc && C:\Qt\5.14.2\mingw73_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.7.25-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.7.25-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "QMAKE_USE += odbc" "QMAKE_LIBS_ODBC = -lodbc32" C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/odbc
    + cd /d C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\odbc && set MAKEFLAGS=& mingw32-make clean && set MAKEFLAGS=& mingw32-make
    > del main.o
    > g++ -c -fno-keep-inline-dllexport -O2 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.7.25-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.14.2\mingw73_32\mkspecs\win32-g++  -o main.o main.cpp
    > g++ -Wl,-s -Wl,-subsystem,console -mthreads -o odbc.exe main.o  -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.7.25-win32\lib -LC:\Utils\postgresql\pgsql\lib -lodbc32   
     => source accepted.
    test config.sqldrivers.libraries.odbc succeeded
    looking for library psql
    Trying source 0 (type pkgConfig) of library psql ...
    pkg-config use disabled globally.
      => source produced no result.
    Trying source 1 (type psqlConfig) of library psql ...
    pg_config not found.
      => source produced no result.
    Trying source 2 (type psqlEnv) of library psql ...
    libpq-fe.h not found in [] and global paths.
      => source produced no result.
    Trying source 3 (type psqlEnv) of library psql ...
      => source failed condition '!config.win32'.
    test config.sqldrivers.libraries.psql FAILED
    looking for library sqlite2
    Trying source 0 (type inline) of library sqlite2 ...
    sqlite.h not found in [] and global paths.
      => source produced no result.
    test config.sqldrivers.libraries.sqlite2 FAILED
    looking for library tds
    Trying source 0 (type sybaseEnv) of library tds ...
    + cd /d C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\tds && C:\Qt\5.14.2\mingw73_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.7.25-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.7.25-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "QMAKE_USE += tds" "QMAKE_LIBS_TDS = -lNTWDBLIB" C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/tds
    + cd /d C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\tds && set MAKEFLAGS=& mingw32-make clean && set MAKEFLAGS=& mingw32-make
    > del main.o
    > C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\tds\main.o konnte nicht gefunden werden
    > g++ -c -fno-keep-inline-dllexport -O2 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.7.25-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.14.2\mingw73_32\mkspecs\win32-g++  -o main.o main.cpp
    > main.cpp:2:10: fatal error: sybfront.h: No such file or directory
    >  #include <sybfront.h>
    >           ^~~~~~~~~~~~
    > compilation terminated.
    > mingw32-make: *** [Makefile:496: main.o] Error 1
     => source failed verification.
    Trying source 1 (type sybaseEnv) of library tds ...
      => source failed condition '!config.win32'.
    test config.sqldrivers.libraries.tds FAILED
    
    

    The path in my gmake call are right and the folders exists.


  • Lifetime Qt Champion

    @Philipp-DE said in compiling mysql plugin qt documentation incomplete:

    it says mysql_config not found.

    No, it says:

    main.o:main.cpp:(.text.startup+0xc): undefined reference to `mysql_get_client_version@0'
    You've more than one mysql lib in your path it seems: C:\Utils\my_sql\mysql-5.7.25-win32\lib - remove and/or don't mix it.



  • Hi,

    I have xampp installed on my computer and xampp contains a mysql version which is in use.

    In my qmake call

    qmake -- MYSQL_INCDIR="C:/Program Files/MySQL/MySQL Connector C 6.1/include" MYSQL_LIBDIR="C:/Program Files/MySQL/MySQL Connector C 6.1/lib"
    

    i have no use of C:\Utils\my_sql .... . That folder does not exists, okay mabe it is invisible.

    Where do you mean, do i need to remove it? I found no entry for this in the system path. Or better how can I prevent to mix it?



  • I have taken a big step forward.

    As I had no Idea what to change and I had already mysql installed with XMAP, I just changes the pathes inside my qmake and let it run again and looked what happens:

    qmake -- MYSQL_INCDIR="C:/MAMP/bin/mysql/include" MYSQL_LIBDIR="C:/MAMP/bin/mysql/lib"
    

    This time I got a yes on mysql.

    Here my log (I am wondering that it still says mysql_config not found.)

    Command line: "MYSQL_INCDIR=C:/MAMP/bin/mysql/include" "MYSQL_LIBDIR=C:/MAMP/bin/mysql/lib"
    Global lib dirs: [C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.7.25-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib] [C:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0 C:/Qt/Tools/mingw730_32/lib/gcc C:/Qt/Tools/mingw730_32/i686-w64-mingw32/lib C:/Qt/Tools/mingw730_32/lib]
    Global inc dirs: [C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.7.25-win32\\include C:\\Utils\\postgresql\\pgsql\\include] [C:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++ C:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/i686-w64-mingw32 C:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/backward C:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include C:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include-fixed C:/Qt/Tools/mingw730_32/i686-w64-mingw32/include]
    looking for library db2
    Trying source 0 (type inline) of library db2 ...
    sqlcli.h not found in [] and global paths.
    sqlcli1.h not found in [] and global paths.
      => source produced no result.
    Trying source 1 (type inline) of library db2 ...
      => source failed condition '!config.win32'.
    test config.sqldrivers.libraries.db2 FAILED
    looking for library ibase
    Trying source 0 (type inline) of library ibase ...
    ibase.h not found in [] and global paths.
      => source produced no result.
    Trying source 1 (type inline) of library ibase ...
      => source failed condition '!config.win32'.
    test config.sqldrivers.libraries.ibase FAILED
    looking for library mysql
    Trying source 0 (type mysqlConfig) of library mysql ...
    mysql_config not found.
      => source produced no result.
    Trying source 1 (type mysqlConfig) of library mysql ...
    mysql_config not found.
      => source produced no result.
    Trying source 2 (type mysqlConfig) of library mysql ...
    mysql_config not found.
      => source produced no result.
    Trying source 3 (type mysqlConfig) of library mysql ...
    mysql_config not found.
      => source produced no result.
    Trying source 4 (type inline) of library mysql ...
      => source failed condition '!config.win32'.
    Trying source 5 (type inline) of library mysql ...
    + cd /d C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\mysql && C:\Qt\5.14.2\mingw73_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.7.25-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.7.25-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "QMAKE_USE += mysql" "QMAKE_LIBS_MYSQL = -LC:/MAMP/bin/mysql/lib -llibmysql" "QMAKE_INCDIR_MYSQL = C:/MAMP/bin/mysql/include" C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql
    + cd /d C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\mysql && set MAKEFLAGS=& mingw32-make clean && set MAKEFLAGS=& mingw32-make
    > del main.o
    > g++ -c -fno-keep-inline-dllexport -O2 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.7.25-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\MAMP\bin\mysql\include -IC:\Qt\5.14.2\mingw73_32\mkspecs\win32-g++  -o main.o main.cpp
    > g++ -Wl,-s -Wl,-subsystem,console -mthreads -o mysql.exe main.o  -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.7.25-win32\lib -LC:\Utils\postgresql\pgsql\lib -LC:\MAMP\bin\mysql\lib -llibmysql   
    > Warning: resolving _mysql_get_client_version@0 by linking to _mysql_get_client_version
    > Use --enable-stdcall-fixup to disable these warnings
    > Use --disable-stdcall-fixup to disable these fixups
     => source accepted.
    test config.sqldrivers.libraries.mysql succeeded
    looking for library oci
    Trying source 0 (type inline) of library oci ...
    oci.h not found in [] and global paths.
      => source produced no result.
    Trying source 1 (type inline) of library oci ...
      => source failed condition '!config.win32'.
    test config.sqldrivers.libraries.oci FAILED
    looking for library odbc
    Trying source 0 (type inline) of library odbc ...
    + cd /d C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\odbc && C:\Qt\5.14.2\mingw73_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.7.25-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.7.25-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "QMAKE_USE += odbc" "QMAKE_LIBS_ODBC = -lodbc32" C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/odbc
    + cd /d C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\odbc && set MAKEFLAGS=& mingw32-make clean && set MAKEFLAGS=& mingw32-make
    > del main.o
    > g++ -c -fno-keep-inline-dllexport -O2 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.7.25-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.14.2\mingw73_32\mkspecs\win32-g++  -o main.o main.cpp
    > g++ -Wl,-s -Wl,-subsystem,console -mthreads -o odbc.exe main.o  -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.7.25-win32\lib -LC:\Utils\postgresql\pgsql\lib -lodbc32   
     => source accepted.
    test config.sqldrivers.libraries.odbc succeeded
    looking for library psql
    Trying source 0 (type pkgConfig) of library psql ...
    pkg-config use disabled globally.
      => source produced no result.
    Trying source 1 (type psqlConfig) of library psql ...
    pg_config not found.
      => source produced no result.
    Trying source 2 (type psqlEnv) of library psql ...
    libpq-fe.h not found in [] and global paths.
      => source produced no result.
    Trying source 3 (type psqlEnv) of library psql ...
      => source failed condition '!config.win32'.
    test config.sqldrivers.libraries.psql FAILED
    looking for library sqlite2
    Trying source 0 (type inline) of library sqlite2 ...
    sqlite.h not found in [] and global paths.
      => source produced no result.
    test config.sqldrivers.libraries.sqlite2 FAILED
    looking for library tds
    Trying source 0 (type sybaseEnv) of library tds ...
    + cd /d C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\tds && C:\Qt\5.14.2\mingw73_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.7.25-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.7.25-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "QMAKE_USE += tds" "QMAKE_LIBS_TDS = -lNTWDBLIB" C:/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/tds
    + cd /d C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\tds && set MAKEFLAGS=& mingw32-make clean && set MAKEFLAGS=& mingw32-make
    > del main.o
    > C:\Qt\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\tds\main.o konnte nicht gefunden werden
    > g++ -c -fno-keep-inline-dllexport -O2 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.7.25-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.14.2\mingw73_32\mkspecs\win32-g++  -o main.o main.cpp
    > main.cpp:2:10: fatal error: sybfront.h: No such file or directory
    >  #include <sybfront.h>
    >           ^~~~~~~~~~~~
    > compilation terminated.
    > mingw32-make: *** [Makefile:496: main.o] Error 1
     => source failed verification.
    Trying source 1 (type sybaseEnv) of library tds ...
      => source failed condition '!config.win32'.
    test config.sqldrivers.libraries.tds FAILED
    
    

    After this I could run

    mingw32-make sub-mysql
    mingw32-make install
    

    mingw32-make sub-mysql does not works before.

    After this I went back wo my qt5 IDE and tried to start my test application.

    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
    

    The change is that the driver is now available. Something seems to work, even I did not understood what the difference was.

    Now I looked into

    C:\Qt\5.14.2\mingw73_32\plugins\sqldrivers
    

    There I will find these files now:

    26.04.2020  20:29         1.318.881 qsqlite.dll
    26.04.2020  20:29         5.163.704 qsqlite.dll.debug
    26.04.2020  20:27           163.398 qsqlmysql.dll
    26.04.2020  20:27         2.040.119 qsqlmysql.dll.debug
    26.04.2020  20:28           189.113 qsqlodbc.dll
    26.04.2020  20:28         2.032.329 qsqlodbc.dll.debug
    27.03.2020  21:04           180.200 qsqlpsql.dll
    

    What do I need to do, to get the driver loaded?

    I always read about libmysql.dll. That file was not created. What files from where to where do I need to copy to solve the problem?



  • Okay, to finanlize:

    I copied

    libmysql.dll
    libmysqld.dll
    

    from

    C:\MAMP\bin\mysql\lib
    

    to

    C:\Qt\5.14.2\mingw73_32\bin
    

    Now everything works fine. MySQL is running!

    It was try and error. Even if did many test for myself, you helped me very much and gave me new ideas.

    I hope this will help other people as well.



  • This post is deleted!

Log in to reply