Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Difficulties creating MySQL plugin for Qt
Qt 6.11 is out! See what's new in the release blog

Difficulties creating MySQL plugin for Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Paul Orasan
    wrote on last edited by
    #1

    Hello, everyone!

    I have been trying to install the MySQL plugin for Qt since yesterday, but I have some difficulties.
    I have download the MySQL Community Installer and installed the MySQL Server 8 and MySQL Connector for C++.

    I have followed this tutorial: https://www.seppemagiels.com/blog/create-mysql-driver-qt5-windows
    but when I run this command :

    C:\WINDOWS\system32>set mysql=C:\\PROGRA~1\\MySQL\\MYSQLS~1.0
    
    C:\WINDOWS\system32>cd C:\Qtold\Sources\qtbase\src\plugins\sqldrivers\mysql
    
    C:\Qtold\Sources\qtbase\src\plugins\sqldrivers\mysql>qmake "INCLUDEPATH+=%mysql%\\include" "LIBS+=%mysql%\\lib\\libmysql.lib" -o Makefile mysql.pro
    
    

    I receive the following error:
    Cannot read C:/Qtold/Sources/qtbase/src/plugins/sqldrivers/qtsqldrivers-config.pri: No such file or directory
    Project ERROR: Library 'mysql' is not defined.

    Can you tell me what I am doing wrong and help me install the plugin please?

    Thank you in advance,
    Paul

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Moderators Qt Champions 2024 Qt Champions 2022 Qt Champions 2017
      wrote on last edited by
      #2

      @Paul-Orasan said in Difficulties creating MySQL plugin for Qt:

      qtsqldrivers-config.pri

      There is bug filed already for this. Can you look at the bug ?

      Dheerendra
      @Community Service
      Certified Qt Specialist
      https://www.pthinks.com

      P 1 Reply Last reply
      0
      • dheerendraD dheerendra

        @Paul-Orasan said in Difficulties creating MySQL plugin for Qt:

        qtsqldrivers-config.pri

        There is bug filed already for this. Can you look at the bug ?

        P Offline
        P Offline
        Paul Orasan
        wrote on last edited by
        #3

        @dheerendra sorry, where should I look?

        1 Reply Last reply
        0
        • dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Moderators Qt Champions 2024 Qt Champions 2022 Qt Champions 2017
          wrote on last edited by
          #4

          BugReports

          Dheerendra
          @Community Service
          Certified Qt Specialist
          https://www.pthinks.com

          P 1 Reply Last reply
          0
          • dheerendraD dheerendra

            BugReports

            P Offline
            P Offline
            Paul Orasan
            wrote on last edited by
            #5

            @dheerendra I understand but then what am I supposed to do now? I really need to make this plugin work.

            1 Reply Last reply
            0
            • P Offline
              P Offline
              Paul Orasan
              wrote on last edited by Paul Orasan
              #6

              I have tried following this official guide: http://doc.qt.io/qt-5/sql-driver.html#qmysql

              This is the error I get after calling mingw32-make:
              c:\mingw\include\winuser.h:51:20: fatal error: stdarg.h: No such file or directory
              #include <stdarg.h>
              ^
              compilation terminated.
              windres: preprocessing failed.
              Makefile.Release:70: recipe for target '.obj/release/qsqlodbc_resource_res.o' failed
              mingw32-make[2]: *** [.obj/release/qsqlodbc_resource_res.o] Error 1
              mingw32-make[2]: Leaving directory 'C:/Qtold/Sources/qtbase/src/plugins/sqldrivers/odbc'
              Makefile:40: recipe for target 'release-all' failed
              mingw32-make[1]: *** [release-all] Error 2
              mingw32-make[1]: Leaving directory 'C:/Qtold/Sources/qtbase/src/plugins/sqldrivers/odbc'
              Makefile:41: recipe for target 'sub-odbc-make_first' failed
              mingw32-make: *** [sub-odbc-make_first] Error 2
              This is the script I ran:

              C:\Qt\Qt5.12.0\5.12.0\mingw73_64>cd C:\Qtold\Sources\qtbase\src\plugins\sqldrivers
              
              C:\Qtold\Sources\qtbase\src\plugins\sqldrivers>qmake -- MYSQL_INCDIR=C:\\PROGRA~1\\MySQL\\MYSQLS~1.0\\include "MYSQL_LIBDIR=C:\\PROGRA~1\\MySQL\\MYSQLS~1.0\\lib"
              C:\Qtold\Sources\qtbase\src\plugins\sqldrivers>mingw32-make
              
              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Hi,

                You didn't follow the guide properly. It says make sub-mysql.

                The way you did it, you are currently trying to build all the plugins which is not what you're after.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                1

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved