Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. QSqlDatabase: QMYSQL driver not loaded

QSqlDatabase: QMYSQL driver not loaded

Scheduled Pinned Locked Moved Unsolved Qt 6
7 Posts 4 Posters 1.3k Views
  • 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
    Patsch36
    wrote on last edited by
    #1

    QSqlDatabase: QMYSQL driver not loaded

    Hello there,
    I've got a problem with the MySQL driver in my QT- C++ project.
    I already tried several solutions from the internet but nothing worked.
    Under C:\Qt\6.3.1\Src\qtbase\src\plugins\sqldrivers is already a MySQL folder with the driver files.

    The error call is:
    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QODBC QPSQL

    My used QT- version is 6.3.1 in Visual Studio 22.
    Is there any solution I could try next? The project code is at Github.

    Thanks for youre help!
    Patrick

    JonBJ 1 Reply Last reply
    0
    • P Patsch36

      QSqlDatabase: QMYSQL driver not loaded

      Hello there,
      I've got a problem with the MySQL driver in my QT- C++ project.
      I already tried several solutions from the internet but nothing worked.
      Under C:\Qt\6.3.1\Src\qtbase\src\plugins\sqldrivers is already a MySQL folder with the driver files.

      The error call is:
      QSqlDatabase: QMYSQL driver not loaded
      QSqlDatabase: available drivers: QSQLITE QODBC QPSQL

      My used QT- version is 6.3.1 in Visual Studio 22.
      Is there any solution I could try next? The project code is at Github.

      Thanks for youre help!
      Patrick

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @Patsch36
      Do the built drivers exists there, or just the sources? And is that directory one where Qt applications look for drivers?

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Patsch36
        wrote on last edited by
        #3

        @JonB
        adb5b97d-603e-44f4-bdef-406907a06fe3-image.png
        That's all what's in the folder, but when I look in the preinstalled SQLite folder, it looks the same.
        How can I figure out wheather the QT Application looks there for drivers? I found the path in another forum to look at.
        Best regards, Patrick

        JonBJ 1 Reply Last reply
        0
        • P Patsch36

          @JonB
          adb5b97d-603e-44f4-bdef-406907a06fe3-image.png
          That's all what's in the folder, but when I look in the preinstalled SQLite folder, it looks the same.
          How can I figure out wheather the QT Application looks there for drivers? I found the path in another forum to look at.
          Best regards, Patrick

          JonBJ Online
          JonBJ Online
          JonB
          wrote on last edited by
          #4

          @Patsch36
          Those are source files. You need to build the driver, or I don't know if somewhere Windows still allows a pre-built download, have a Google.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            anil_arise
            wrote on last edited by anil_arise
            #5

            @Patsch36 need to install libmysql.dll and follow Readme

            1 Reply Last reply
            1
            • P Offline
              P Offline
              Patsch36
              wrote on last edited by
              #6

              @anil_arise
              Thanks for your answer!
              I followed the instructions step by step and the driver got installed.
              Now the error message is
              QSqlDatabase: QMYSQL driver not loaded
              QSqlDatabase: available drivers: QSQLITE QMARIADB QMYSQL QODBC QPSQL

              How can be the driver now available but does still not work?

              jsulmJ 1 Reply Last reply
              0
              • P Patsch36

                @anil_arise
                Thanks for your answer!
                I followed the instructions step by step and the driver got installed.
                Now the error message is
                QSqlDatabase: QMYSQL driver not loaded
                QSqlDatabase: available drivers: QSQLITE QMARIADB QMYSQL QODBC QPSQL

                How can be the driver now available but does still not work?

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

                @Patsch36 said in QSqlDatabase: QMYSQL driver not loaded:

                How can be the driver now available but does still not work?

                Set QT_DEBUG_PLUGINS environment variable before starting your app, then post the output from terminal here.
                https://doc.qt.io/qt-6/debug.html

                Also, exact same questions is asked many many times, please search in this forum.

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

                1 Reply Last reply
                2

                • Login

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