Important: Please read the Qt Code of Conduct -

How to create the plugin of MYSQL for Qt

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You need to first install the sources. Use the installer for that

  • OK now I have installed the sources (maybe) and I have a folder called Src, this is my path: C:\Qt\5.3\Src.

    I try to follow the tutorial but in my situation when prompt "reimp libmysql.dll" I receive this message:

    "reimp: libmysql.dll: invalid or corrupt import library"

    but if prompt "reimp libmysql.lib" seems to work.

  • now I'm arrived to step 5 but I think I have some problem, this is the ouput after lunch the command:

    configure.exe -debug-and-release -platform win32-g++ -qt-sql-mysql -l mysql -I C:\mysql\include -L C:\mysql\lib

    Creating qmake...
    mingw32-make: Nothing to be done for 'first'.
    Running configuration tests...
    g++: error: CreateProcess: No such file or directory
    mingw32-make: *** [arch.o] Error 1
    Could not find output file: No such file or directory
    WARNING: The DirectX SDK could not be detected:
    There is no Direct X SDK installed or the environment variable "DXSDK_DIR" is
    not set.
    Disabling the ANGLE backend.

    WARNING: Using OpenGL ES 2.0 without ANGLE.
    Specify -opengl desktop to use Open GL.
    The build will most likely fail.

  • Lifetime Qt Champion

    Either install the Direct X SDK or pass -opengl desktop to configure

  • I'm sorry and frustrated but
    but unfortunately for me it is the first time with C++ and QT.
    I lunch configure:

    configure.exe -opengl desktop

    and the result is:

    g++ -c -o qlibraryinfo.o -DUNICODE -ffunction-sections -g -IC:\Qt\5.3\Src\qtbas
    e/qmake -IC:\Qt\5.3\Src\qtbase/qmake/library -IC:\Qt\5.3\Src\qtbase/qmake/genera
    tors -IC:\Qt\5.3\Src\qtbase/qmake/generators/unix -IC:\Qt\5.3\Src\qtbase/qmake/g
    enerators/win32 -IC:\Qt\5.3\Src\qtbase/qmake/generators/mac -IC:\Qt\5.3\Src\qtba
    se/qmake/generators/integrity -IC:\Qt\5.3\Src\qtbase\include -IC:\Qt\5.3\Src\qtb
    ase\include/QtCore -IC:\Qt\5.3\Src\qtbase\include/QtCore/5.3.2 -IC:\Qt\5.3\Src\q
    tbase\include/QtCore/5.3.2/QtCore -IC:\Qt\5.3\Src\qtbase/src/corelib/global -DHA
    VE_QCONFIG_CPP -IC:\Qt\5.3\Src\qtbase\mkspecs\win32-g++ -IC:\Qt\5.3\Src\qtbase/t
    SHA1 -DQT_JSON_READONLY C:\Qt\5.3\Src\qtbase/src/corelib/global/qlibraryinfo.cp
    g++: error: CreateProcess: No such file or directory
    Makefile:275: recipe for target 'qlibraryinfo.o' failed
    mingw32-make: *** [qlibraryinfo.o] Error 1
    rm -f project.o option.o property.o main.o ioutils.o proitems.o qmakevfs.o qmake
    globals.o qmakeparser.o qmakeevaluator.o qmakebuiltins.o makefile.o unixmake2.o
    unixmake.o mingw_make.o winmakefile.o projectgenerator.o meta.o makefiledeps.o m
    etamakefile.o xmloutput.o pbuilder_pbx.o msvc_vcproj.o msvc_vcxproj.o msvc_nmake
    .o msvc_objectmodel.o msbuild_objectmodel.o gbuild.o cesdkhandler.o qtextcodec.o
    qutfcodec.o qstring.o qstring_compat.o qstringbuilder.o qtextstream.o qiodevice
    .o qmalloc.o qglobal.o qarraydata.o qbytearray.o qbytearraymatcher.o qdatastream
    .o qbuffer.o qlist.o qfiledevice.o qfile.o qfilesystementry.o qfilesystemengine.
    o qfsfileengine.o qfsfileengine_iterator.o qregexp.o qvector.o qbitarray.o qdir.
    o qdiriterator.o quuid.o qhash.o qfileinfo.o qdatetime.o qstringlist.o qabstract
    fileengine.o qtemporaryfile.o qmap.o qmetatype.o qsettings.o qsystemerror.o qlib
    raryinfo.o qvariant.o qvsnprintf.o qlocale.o qlocale_tools.o qlinkedlist.o qnume
    ric.o qcryptographichash.o qxmlstream.o qxmlutils.o qlogging.o qjson.o qjsondocument.o qjsonparser.o qjsonarray.o qjsonobject.o qjsonvalue.o qfilesystemengine_w
    in.o qfilesystemiterator_win.o qfsfileengine_win.o qlocale_win.o qsettings_win.o
    qsystemlibrary.o registry.o
    g++ -c -o project.o -DUNICODE -ffunction-sections -g -IC:\Qt\5.3\Src\qtbase/qma
    ke -IC:\Qt\5.3\Src\qtbase/qmake/library -IC:\Qt\5.3\Src\qtbase/qmake/generators
    -IC:\Qt\5.3\Src\qtbase/qmake/generators/unix -IC:\Qt\5.3\Src\qtbase/qmake/genera
    tors/win32 -IC:\Qt\5.3\Src\qtbase/qmake/generators/mac -IC:\Qt\5.3\Src\qtbase/qm
    ake/generators/integrity -IC:\Qt\5.3\Src\qtbase\include -IC:\Qt\5.3\Src\qtbase\i
    nclude/QtCore -IC:\Qt\5.3\Src\qtbase\include/QtCore/5.3.2 -IC:\Qt\5.3\Src\qtbase
    \include/QtCore/5.3.2/QtCore -IC:\Qt\5.3\Src\qtbase/src/corelib/global -DHAVE_QC
    ONFIG_CPP -IC:\Qt\5.3\Src\qtbase\mkspecs\win32-g++ -IC:\Qt\5.3\Src\qtbase/tools/

    -DQT_JSON_READONLY C:\Qt\5.3\Src\qtbase/qmake/project.cpp
    g++: error: CreateProcess:* No such file or directory*
    Makefile:196: recipe for target 'project.o' failed
    mingw32-make: *** [project.o] Error 1
    Building qmake failed, return code 2

  • Lifetime Qt Champion

    Just one question, do you only need to build the MySQL plugin ? If so, there's no need to rebuild Qt completely

  • This is the first time for me with C++ and QT so for me it's all new and I do not know what are the requirements needed to achieve my goal.
    I want to make a windows application that keep some signal from a RFID antenna attached to notebook from serial and store data in a mysql database.
    To start I want only to connect to mysql database and read a table data.

    So I guess I need only mysql plugin.

  • Lifetime Qt Champion

    Then just compile the MySQL plugin like described in the documentation, no need to rebuild everything.

  • @
    case "re":
    case "re_ok":
    case "del":
    case "all_del_ok":
    case "all_move_ok":

  • Lifetime Qt Champion

    What does that message have to do with the current question ?

  • what about other platform?

  • Lifetime Qt Champion

    Can you be more specific ?

  • Hi all,

    after trying to build mysql plugin now I cannot to compile a simple hello world project, the error is:

    g++: error: CreateProcess: No such file or directory

    this is my debugger output:

    @11:46:35: Running steps for project CEV-Crono...
    11:46:35: Configuration unchanged, skipping qmake step.
    11:46:35: Starting: "C:\Qt\5.3\mingw482_32\bin\mingw32-make.exe"
    C:/Qt/5.3/mingw482_32/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory 'F:/WORKSPACE/CPP/build-CEV-Crono-Desktop_Qt_5_3_MinGW_32bit-Debug'
    g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\CEV-Crono -I"C:\Qt\5.3\mingw482_32\include" -I"C:\Qt\5.3\mingw482_32\include\QtWidgets" -I"C:\Qt\5.3\mingw482_32\include\QtGui" -I"C:\Qt\5.3\mingw482_32\include\QtCore" -I"debug" -I"." -I"." -I"C:\Qt\5.3\mingw482_32\mkspecs\win32-g++" -o debug\main.o ..\CEV-Crono\main.cpp
    g++: error: CreateProcess: No such file or directory
    Makefile.Debug:341: recipe for target 'debug/main.o' failed
    mingw32-make[1]: *** [debug/main.o] Error 1
    mingw32-make[1]: Leaving directory 'F:/WORKSPACE/CPP/build-CEV-Crono-Desktop_Qt_5_3_MinGW_32bit-Debug'
    Makefile:34: recipe for target 'debug' failed
    mingw32-make: *** [debug] Error 2
    11:46:35: The process "C:\Qt\5.3\mingw482_32\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project CEV-Crono (kit: Desktop Qt 5.3 MinGW 32bit)
    When executing step "Make"
    11:46:35: Elapsed time: 00:01.@

  • That would of been useful about 2 months ago, but thanks for posting it

  • This post is deleted!

  • I m sorry for not being able to reply ^^ cause i ve moved to the web development world for a moment, thus i have forgotten about this post! anyway the instructions i did were for Windows, but i never tried the other platforms tough :/ sorry! @massum, and a big thanks to @SGaist ^^

  • Lifetime Qt Champion

    Each platform has it's own gotchas but the *nix variants are generally more easy to deal with when it comes to dependencies like MySQL

    You're welcome :)

  • Hello EveryOne,
    I am a beginner to qt and unable to build a mysql driver. I'am stuck at step4 of above given steps.
    reimp -d libmysql.dll ,gives me error
    "reimp: libmysql.dll: invalid or corrupt import library"

    iam also unable to
    reimp libmysql.lib, gives me error
    "reimp: libmysql.lib: invalid or corrupt import library"

    reimp.exe is available from mingw-utils-0.3, but i am totally frustrated now due to failure occured multiple times.
    I need help urgently, since project deadline is near. Will anyone please upload libqsqlmysql.a and qsqlmysql.dll on any ftp site or mail me these as an attachment. i followed all the given steps, but failed to compile.
    my mail id is:
    plz guys,help me!!!!!
    I seriously need ur help in order to complete this project.

  • Why cannot QSqlQuery execute "exit" sentence, but can execute other general query sentences?

  • @flydragon

    Do not duplicate posting because you do not get an answer immendiately.

    [edit:koahnig see ]

Log in to reply