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. How to create Qt 6.5 mysql driver with cmake?
Forum Updated to NodeBB v4.3 + New Features

How to create Qt 6.5 mysql driver with cmake?

Scheduled Pinned Locked Moved Unsolved General and Desktop
60 Posts 8 Posters 9.8k Views 3 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.
  • S Saad02

    @thecodemonkey
    62be54c3-1dbd-4f20-8628-555ec7859c58-image.png
    36e33d9e-e8ee-49ed-9a81-9acb94cc1206-image.png
    e8916716-4c06-4cd6-a85e-8a7484042861-image.png
    9a22a9b9-8fc8-456b-b124-b157f97ee167-image.png

    Also, added "qsqlmysql.dll_Qt_SQL_driver_6.5.1_MinGW_11.2.0_64-bit" folder in environment variables' system variables' path.
    I have nothing to hide :)

    T Offline
    T Offline
    thecodemonkey
    wrote on last edited by thecodemonkey
    #22

    @Saad02 ok, but I meant if there are any error messages while connecting to MySQL when you run your project. And if so, did you set QT_DEBUG_PLUGINS environment variable to value 1 which might reveal the reason

    S 1 Reply Last reply
    0
    • T thecodemonkey

      @Saad02 ok, but I meant if there are any error messages while connecting to MySQL when you run your project. And if so, did you set QT_DEBUG_PLUGINS environment variable to value 1 which might reveal the reason

      S Offline
      S Offline
      Saad02
      wrote on last edited by Saad02
      #23

      @thecodemonkey Sir, I am providing you the qt creator messages.
      Application Output:
      QSqlDatabase: QMYSQL driver not loaded
      QSqlDatabase: available drivers: QSQLITE QMARIADB QMYSQL QODBC QPSQL

      Compile Output:
      C:/Qt/Tools/mingw1120_64/bin/mingw32-make -f Makefile.Release
      mingw32-make[1]: Entering directory 'C:/Users/Saad/Documents/qt c++/build-database-Desktop_Qt_6_5_1_MinGW_64_bit-Release'
      C:\Qt\6.5.1\mingw_64\bin\uic.exe ..\database\mainwindow.ui -o ui_mainwindow.h
      g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++1z -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../database -I. -IC:/Qt/6.5.1/mingw_64/include -IC:/Qt/6.5.1/mingw_64/include/QtWidgets -IC:/Qt/6.5.1/mingw_64/include/QtGui -IC:/Qt/6.5.1/mingw_64/include/QtSql -IC:/Qt/6.5.1/mingw_64/include/QtCore -Irelease -I. -I/include -IC:/Qt/6.5.1/mingw_64/mkspecs/win32-g++ -o release\main.o ..\database\main.cpp
      g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++1z -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../database -I. -IC:/Qt/6.5.1/mingw_64/include -IC:/Qt/6.5.1/mingw_64/include/QtWidgets -IC:/Qt/6.5.1/mingw_64/include/QtGui -IC:/Qt/6.5.1/mingw_64/include/QtSql -IC:/Qt/6.5.1/mingw_64/include/QtCore -Irelease -I. -I/include -IC:/Qt/6.5.1/mingw_64/mkspecs/win32-g++ -o release\mainwindow.o ..\database\mainwindow.cpp
      C:\Qt\6.5.1\mingw_64\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN --include "C:/Users/Saad/Documents/qt c++/build-database-Desktop_Qt_6_5_1_MinGW_64_bit-Release/release/moc_predefs.h" -IC:/Qt/6.5.1/mingw_64/mkspecs/win32-g++ -I"C:/Users/Saad/Documents/qt c++/database" -IC:/Qt/6.5.1/mingw_64/include -IC:/Qt/6.5.1/mingw_64/include/QtWidgets -IC:/Qt/6.5.1/mingw_64/include/QtGui -IC:/Qt/6.5.1/mingw_64/include/QtSql -IC:/Qt/6.5.1/mingw_64/include/QtCore -I. -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++ -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/x86_64-w64-mingw32 -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/backward -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed -IC:/Qt/Tools/mingw1120_64/x86_64-w64-mingw32/include ..\database\mainwindow.h -o release\moc_mainwindow.cpp
      g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++1z -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../database -I. -IC:/Qt/6.5.1/mingw_64/include -IC:/Qt/6.5.1/mingw_64/include/QtWidgets -IC:/Qt/6.5.1/mingw_64/include/QtGui -IC:/Qt/6.5.1/mingw_64/include/QtSql -IC:/Qt/6.5.1/mingw_64/include/QtCore -Irelease -I. -I/include -IC:/Qt/6.5.1/mingw_64/mkspecs/win32-g++ -o release\moc_mainwindow.o release\moc_mainwindow.cpp
      g++ -Wl,-s -Wl,-subsystem,windows -mthreads -o release\database.exe release/main.o release/mainwindow.o release/moc_mainwindow.o C:\Qt\6.5.1\mingw_64\lib\libQt6Widgets.a C:\Qt\6.5.1\mingw_64\lib\libQt6Gui.a C:\Qt\6.5.1\mingw_64\lib\libQt6Sql.a C:\Qt\6.5.1\mingw_64\lib\libQt6Core.a -lmingw32 C:\Qt\6.5.1\mingw_64\lib\libQt6EntryPoint.a -lshell32
      mingw32-make[1]: Leaving directory 'C:/Users/Saad/Documents/qt c++/build-database-Desktop_Qt_6_5_1_MinGW_64_bit-Release'
      17:03:21: The process "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" exited normally.
      17:03:21: Elapsed time: 00:16.

      T 1 Reply Last reply
      0
      • S Saad02

        @thecodemonkey Sir, I am providing you the qt creator messages.
        Application Output:
        QSqlDatabase: QMYSQL driver not loaded
        QSqlDatabase: available drivers: QSQLITE QMARIADB QMYSQL QODBC QPSQL

        Compile Output:
        C:/Qt/Tools/mingw1120_64/bin/mingw32-make -f Makefile.Release
        mingw32-make[1]: Entering directory 'C:/Users/Saad/Documents/qt c++/build-database-Desktop_Qt_6_5_1_MinGW_64_bit-Release'
        C:\Qt\6.5.1\mingw_64\bin\uic.exe ..\database\mainwindow.ui -o ui_mainwindow.h
        g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++1z -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../database -I. -IC:/Qt/6.5.1/mingw_64/include -IC:/Qt/6.5.1/mingw_64/include/QtWidgets -IC:/Qt/6.5.1/mingw_64/include/QtGui -IC:/Qt/6.5.1/mingw_64/include/QtSql -IC:/Qt/6.5.1/mingw_64/include/QtCore -Irelease -I. -I/include -IC:/Qt/6.5.1/mingw_64/mkspecs/win32-g++ -o release\main.o ..\database\main.cpp
        g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++1z -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../database -I. -IC:/Qt/6.5.1/mingw_64/include -IC:/Qt/6.5.1/mingw_64/include/QtWidgets -IC:/Qt/6.5.1/mingw_64/include/QtGui -IC:/Qt/6.5.1/mingw_64/include/QtSql -IC:/Qt/6.5.1/mingw_64/include/QtCore -Irelease -I. -I/include -IC:/Qt/6.5.1/mingw_64/mkspecs/win32-g++ -o release\mainwindow.o ..\database\mainwindow.cpp
        C:\Qt\6.5.1\mingw_64\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN --include "C:/Users/Saad/Documents/qt c++/build-database-Desktop_Qt_6_5_1_MinGW_64_bit-Release/release/moc_predefs.h" -IC:/Qt/6.5.1/mingw_64/mkspecs/win32-g++ -I"C:/Users/Saad/Documents/qt c++/database" -IC:/Qt/6.5.1/mingw_64/include -IC:/Qt/6.5.1/mingw_64/include/QtWidgets -IC:/Qt/6.5.1/mingw_64/include/QtGui -IC:/Qt/6.5.1/mingw_64/include/QtSql -IC:/Qt/6.5.1/mingw_64/include/QtCore -I. -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++ -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/x86_64-w64-mingw32 -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/backward -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include -IC:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed -IC:/Qt/Tools/mingw1120_64/x86_64-w64-mingw32/include ..\database\mainwindow.h -o release\moc_mainwindow.cpp
        g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++1z -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../database -I. -IC:/Qt/6.5.1/mingw_64/include -IC:/Qt/6.5.1/mingw_64/include/QtWidgets -IC:/Qt/6.5.1/mingw_64/include/QtGui -IC:/Qt/6.5.1/mingw_64/include/QtSql -IC:/Qt/6.5.1/mingw_64/include/QtCore -Irelease -I. -I/include -IC:/Qt/6.5.1/mingw_64/mkspecs/win32-g++ -o release\moc_mainwindow.o release\moc_mainwindow.cpp
        g++ -Wl,-s -Wl,-subsystem,windows -mthreads -o release\database.exe release/main.o release/mainwindow.o release/moc_mainwindow.o C:\Qt\6.5.1\mingw_64\lib\libQt6Widgets.a C:\Qt\6.5.1\mingw_64\lib\libQt6Gui.a C:\Qt\6.5.1\mingw_64\lib\libQt6Sql.a C:\Qt\6.5.1\mingw_64\lib\libQt6Core.a -lmingw32 C:\Qt\6.5.1\mingw_64\lib\libQt6EntryPoint.a -lshell32
        mingw32-make[1]: Leaving directory 'C:/Users/Saad/Documents/qt c++/build-database-Desktop_Qt_6_5_1_MinGW_64_bit-Release'
        17:03:21: The process "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" exited normally.
        17:03:21: Elapsed time: 00:16.

        T Offline
        T Offline
        thecodemonkey
        wrote on last edited by
        #24

        @Saad02 I don't see the output that is printed if the environment variable QT_DEBUG_PLUGINS=1 is set. Could you run the project as debug build?

        S 1 Reply Last reply
        0
        • T thecodemonkey

          @Saad02 I don't see the output that is printed if the environment variable QT_DEBUG_PLUGINS=1 is set. Could you run the project as debug build?

          S Offline
          S Offline
          Saad02
          wrote on last edited by
          #25

          @thecodemonkey Nothing changed. I got the same output. Do I have to somewhere else except Qt Creator?

          jsulmJ 1 Reply Last reply
          0
          • S Saad02

            @thecodemonkey Nothing changed. I got the same output. Do I have to somewhere else except Qt Creator?

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #26

            @Saad02 said in How to create Qt 6.5 mysql driver with cmake?:

            Do I have to somewhere else except Qt Creator?

            No, you just need to do it properly. You need to set QT_DEBUG_PLUGINS=1 in Run settings of your project in QtCreator.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            S 1 Reply Last reply
            0
            • jsulmJ jsulm

              @Saad02 said in How to create Qt 6.5 mysql driver with cmake?:

              Do I have to somewhere else except Qt Creator?

              No, you just need to do it properly. You need to set QT_DEBUG_PLUGINS=1 in Run settings of your project in QtCreator.

              S Offline
              S Offline
              Saad02
              wrote on last edited by
              #27

              @jsulm Sir, you mean that file with ".pro" extension right?
              database.pro:
              QT += core gui sql

              greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

              CONFIG += c++17
              QT_DEBUG_PLUGINS=1

              You can make your code fail to compile if it uses deprecated APIs.

              In order to do so, uncomment the following line.

              #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

              SOURCES +=
              main.cpp
              mainwindow.cpp

              HEADERS +=
              mainwindow.h

              FORMS +=
              mainwindow.ui

              Default rules for deployment.

              qnx: target.path = /tmp/$${TARGET}/bin
              else: unix:!android: target.path = /opt/$${TARGET}/bin
              !isEmpty(target.path): INSTALLS += target

              Nothing changed!

              jsulmJ 1 Reply Last reply
              0
              • S Saad02

                @jsulm Sir, you mean that file with ".pro" extension right?
                database.pro:
                QT += core gui sql

                greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

                CONFIG += c++17
                QT_DEBUG_PLUGINS=1

                You can make your code fail to compile if it uses deprecated APIs.

                In order to do so, uncomment the following line.

                #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

                SOURCES +=
                main.cpp
                mainwindow.cpp

                HEADERS +=
                mainwindow.h

                FORMS +=
                mainwindow.ui

                Default rules for deployment.

                qnx: target.path = /tmp/$${TARGET}/bin
                else: unix:!android: target.path = /opt/$${TARGET}/bin
                !isEmpty(target.path): INSTALLS += target

                Nothing changed!

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #28

                @Saad02 said in How to create Qt 6.5 mysql driver with cmake?:

                you mean that file with ".pro" extension right?

                No, I did not say a single word about the pro file.
                You were asked to set QT_DEBUG_PLUGINS anvironment variable to 1 before starting your application.
                You can set it in QtCreator if you go to "Projects/Build & Run/Run/Run Environment".

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                S 1 Reply Last reply
                0
                • jsulmJ jsulm

                  @Saad02 said in How to create Qt 6.5 mysql driver with cmake?:

                  you mean that file with ".pro" extension right?

                  No, I did not say a single word about the pro file.
                  You were asked to set QT_DEBUG_PLUGINS anvironment variable to 1 before starting your application.
                  You can set it in QtCreator if you go to "Projects/Build & Run/Run/Run Environment".

                  S Offline
                  S Offline
                  Saad02
                  wrote on last edited by
                  #29

                  @jsulm Sir, I don't have "run environment" in run...
                  ca4fc873-5149-4f0e-957d-519b7ba1b168-image.png

                  jsulmJ 1 Reply Last reply
                  0
                  • S Saad02

                    @jsulm Sir, I don't have "run environment" in run...
                    ca4fc873-5149-4f0e-957d-519b7ba1b168-image.png

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #30

                    @Saad02 said in How to create Qt 6.5 mysql driver with cmake?:

                    I don't have "run environment" in run

                    Of course you have, you just need to look bellow the part you posted, really...

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    S 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @Saad02 said in How to create Qt 6.5 mysql driver with cmake?:

                      I don't have "run environment" in run

                      Of course you have, you just need to look bellow the part you posted, really...

                      S Offline
                      S Offline
                      Saad02
                      wrote on last edited by
                      #31

                      @jsulm Sir, the red marked one showing me my system variables, not run environment variable.
                      1eb5abed-37d9-483e-bfc9-5ffbc2fcd279-image.png
                      And this is the rest-
                      c73f879f-e8bb-454a-a669-f902f1bbf016-image.png
                      Here is all I have in "run".
                      By the way, the internet connection in our local is currently unstable. Can it be the reason for that driver not to load?

                      SGaistS 1 Reply Last reply
                      0
                      • S Saad02

                        @jsulm Sir, the red marked one showing me my system variables, not run environment variable.
                        1eb5abed-37d9-483e-bfc9-5ffbc2fcd279-image.png
                        And this is the rest-
                        c73f879f-e8bb-454a-a669-f902f1bbf016-image.png
                        Here is all I have in "run".
                        By the way, the internet connection in our local is currently unstable. Can it be the reason for that driver not to load?

                        SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #32

                        @Saad02 do you see the arrow at the far right ? Click on it to show the variables.

                        Plugin loading and internet connection are unrelated

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

                        S 1 Reply Last reply
                        1
                        • SGaistS SGaist

                          @Saad02 do you see the arrow at the far right ? Click on it to show the variables.

                          Plugin loading and internet connection are unrelated

                          S Offline
                          S Offline
                          Saad02
                          wrote on last edited by
                          #33

                          @SGaist Sir, it is showing me my system variable. Not "run variable". I think I am doing something wrong. Should I reinstall QT? And what version should I install?
                          6a23905a-0075-44e0-856a-eb55bcbfb177-image.png

                          JonBJ 1 Reply Last reply
                          0
                          • S Saad02

                            @SGaist Sir, it is showing me my system variable. Not "run variable". I think I am doing something wrong. Should I reinstall QT? And what version should I install?
                            6a23905a-0075-44e0-856a-eb55bcbfb177-image.png

                            JonBJ Offline
                            JonBJ Offline
                            JonB
                            wrote on last edited by
                            #34

                            @Saad02
                            It seems to clearly show your Run environment, and that by default is the same as your System environment.

                            You have been asked to add a QT_DEBUG_PLUGINS environment variable into the Run environment, so do so.

                            Or, just run your executable from a terminal shell and add the environment variable there.

                            S 1 Reply Last reply
                            0
                            • JonBJ JonB

                              @Saad02
                              It seems to clearly show your Run environment, and that by default is the same as your System environment.

                              You have been asked to add a QT_DEBUG_PLUGINS environment variable into the Run environment, so do so.

                              Or, just run your executable from a terminal shell and add the environment variable there.

                              S Offline
                              S Offline
                              Saad02
                              wrote on last edited by
                              #35

                              @JonB Done and nothing much happened.
                              3085b636-941b-46f4-915e-58c3cfa84a4d-image.png
                              Application Output:
                              QSqlDatabase: QMYSQL driver not loaded
                              QSqlDatabase: available drivers: QSQLITE QMARIADB QMYSQL QODBC QPSQL

                              Compile Output:
                              18:27:06: Running steps for project database...
                              18:27:06: Starting: "C:\Qt\6.5.1\mingw_64\bin\qmake.exe" "C:\Users\Saad\Documents\qt c++\database\database.pro" -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
                              18:27:10: The process "C:\Qt\6.5.1\mingw_64\bin\qmake.exe" exited normally.
                              18:27:10: Starting: "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" -f "C:/Users/Saad/Documents/qt c++/build-database-Desktop_Qt_6_5_1_MinGW_64_bit-Debug/Makefile" qmake_all
                              mingw32-make: Nothing to be done for 'qmake_all'.
                              18:27:10: The process "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" exited normally.
                              18:27:10: Starting: "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" -j4
                              C:/Qt/Tools/mingw1120_64/bin/mingw32-make -f Makefile.Debug
                              mingw32-make[1]: Entering directory 'C:/Users/Saad/Documents/qt c++/build-database-Desktop_Qt_6_5_1_MinGW_64_bit-Debug'
                              mingw32-make[1]: Nothing to be done for 'first'.
                              mingw32-make[1]: Leaving directory 'C:/Users/Saad/Documents/qt c++/build-database-Desktop_Qt_6_5_1_MinGW_64_bit-Debug'
                              18:27:11: The process "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" exited normally.
                              18:27:11: Elapsed time: 00:05.

                              JonBJ jsulmJ 2 Replies Last reply
                              0
                              • S Saad02

                                @JonB Done and nothing much happened.
                                3085b636-941b-46f4-915e-58c3cfa84a4d-image.png
                                Application Output:
                                QSqlDatabase: QMYSQL driver not loaded
                                QSqlDatabase: available drivers: QSQLITE QMARIADB QMYSQL QODBC QPSQL

                                Compile Output:
                                18:27:06: Running steps for project database...
                                18:27:06: Starting: "C:\Qt\6.5.1\mingw_64\bin\qmake.exe" "C:\Users\Saad\Documents\qt c++\database\database.pro" -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
                                18:27:10: The process "C:\Qt\6.5.1\mingw_64\bin\qmake.exe" exited normally.
                                18:27:10: Starting: "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" -f "C:/Users/Saad/Documents/qt c++/build-database-Desktop_Qt_6_5_1_MinGW_64_bit-Debug/Makefile" qmake_all
                                mingw32-make: Nothing to be done for 'qmake_all'.
                                18:27:10: The process "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" exited normally.
                                18:27:10: Starting: "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" -j4
                                C:/Qt/Tools/mingw1120_64/bin/mingw32-make -f Makefile.Debug
                                mingw32-make[1]: Entering directory 'C:/Users/Saad/Documents/qt c++/build-database-Desktop_Qt_6_5_1_MinGW_64_bit-Debug'
                                mingw32-make[1]: Nothing to be done for 'first'.
                                mingw32-make[1]: Leaving directory 'C:/Users/Saad/Documents/qt c++/build-database-Desktop_Qt_6_5_1_MinGW_64_bit-Debug'
                                18:27:11: The process "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" exited normally.
                                18:27:11: Elapsed time: 00:05.

                                JonBJ Offline
                                JonBJ Offline
                                JonB
                                wrote on last edited by
                                #36

                                @Saad02
                                I can only say that, although you seem to have done the right thing, this is not correct output when setting QT_DEBUG_PLUGINS=1. You can verify that by searching the hundreds of occasions it has been used in this forum's questions or on the web.

                                Since I don't know exactly about Creator I suggest you set it in a shell and run your executable from there.

                                JonBJ 1 Reply Last reply
                                0
                                • S Saad02

                                  @JonB Done and nothing much happened.
                                  3085b636-941b-46f4-915e-58c3cfa84a4d-image.png
                                  Application Output:
                                  QSqlDatabase: QMYSQL driver not loaded
                                  QSqlDatabase: available drivers: QSQLITE QMARIADB QMYSQL QODBC QPSQL

                                  Compile Output:
                                  18:27:06: Running steps for project database...
                                  18:27:06: Starting: "C:\Qt\6.5.1\mingw_64\bin\qmake.exe" "C:\Users\Saad\Documents\qt c++\database\database.pro" -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
                                  18:27:10: The process "C:\Qt\6.5.1\mingw_64\bin\qmake.exe" exited normally.
                                  18:27:10: Starting: "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" -f "C:/Users/Saad/Documents/qt c++/build-database-Desktop_Qt_6_5_1_MinGW_64_bit-Debug/Makefile" qmake_all
                                  mingw32-make: Nothing to be done for 'qmake_all'.
                                  18:27:10: The process "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" exited normally.
                                  18:27:10: Starting: "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" -j4
                                  C:/Qt/Tools/mingw1120_64/bin/mingw32-make -f Makefile.Debug
                                  mingw32-make[1]: Entering directory 'C:/Users/Saad/Documents/qt c++/build-database-Desktop_Qt_6_5_1_MinGW_64_bit-Debug'
                                  mingw32-make[1]: Nothing to be done for 'first'.
                                  mingw32-make[1]: Leaving directory 'C:/Users/Saad/Documents/qt c++/build-database-Desktop_Qt_6_5_1_MinGW_64_bit-Debug'
                                  18:27:11: The process "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" exited normally.
                                  18:27:11: Elapsed time: 00:05.

                                  jsulmJ Offline
                                  jsulmJ Offline
                                  jsulm
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #37

                                  @Saad02 said in How to create Qt 6.5 mysql driver with cmake?:

                                  Application Output:

                                  There should be more output if QT_DEBUG_PLUGINS was set - is that really all you get?

                                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  S 1 Reply Last reply
                                  0
                                  • jsulmJ jsulm

                                    @Saad02 said in How to create Qt 6.5 mysql driver with cmake?:

                                    Application Output:

                                    There should be more output if QT_DEBUG_PLUGINS was set - is that really all you get?

                                    S Offline
                                    S Offline
                                    Saad02
                                    wrote on last edited by Saad02
                                    #38

                                    @jsulm Yes, sir.
                                    7c800bc0-1b62-477b-ac5b-799c2abdac38-image.png

                                    Should I shift to qt 5, since it's easier to create one for qt as it uses qmake? And if I do, then what will I miss there?

                                    1 Reply Last reply
                                    0
                                    • JonBJ JonB

                                      @Saad02
                                      I can only say that, although you seem to have done the right thing, this is not correct output when setting QT_DEBUG_PLUGINS=1. You can verify that by searching the hundreds of occasions it has been used in this forum's questions or on the web.

                                      Since I don't know exactly about Creator I suggest you set it in a shell and run your executable from there.

                                      JonBJ Offline
                                      JonBJ Offline
                                      JonB
                                      wrote on last edited by JonB
                                      #39

                                      @Saad02

                                      @JonB said in How to create Qt 6.5 mysql driver with cmake?:

                                      Since I don't know exactly about Creator I suggest you set it [set QT_DEBUG_PLUGINS=1] in a shell and run your executable from there.

                                      Did you try this? You have to know how to run your executable outside of Creator, else it will be useless in the the long-term, you cannot always require your code to run inside Creator!

                                      S 1 Reply Last reply
                                      0
                                      • JonBJ JonB

                                        @Saad02

                                        @JonB said in How to create Qt 6.5 mysql driver with cmake?:

                                        Since I don't know exactly about Creator I suggest you set it [set QT_DEBUG_PLUGINS=1] in a shell and run your executable from there.

                                        Did you try this? You have to know how to run your executable outside of Creator, else it will be useless in the the long-term, you cannot always require your code to run inside Creator!

                                        S Offline
                                        S Offline
                                        Saad02
                                        wrote on last edited by
                                        #40

                                        @JonB Isn't this what he meant-
                                        a89c4f06-cd5e-4ab2-ba93-192b7df7bc53-image.png
                                        Please let me know if I have run it in the wrong terminal.

                                        JonBJ 1 Reply Last reply
                                        0
                                        • S Saad02

                                          @JonB Isn't this what he meant-
                                          a89c4f06-cd5e-4ab2-ba93-192b7df7bc53-image.png
                                          Please let me know if I have run it in the wrong terminal.

                                          JonBJ Offline
                                          JonBJ Offline
                                          JonB
                                          wrote on last edited by
                                          #41

                                          @Saad02 Yes, that is right, now you have to run your program from there.

                                          S 1 Reply Last reply
                                          0

                                          • Login

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