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. qt and mysql connection QMYSQL driver is not even in the list of available drivers
QtWS25 Last Chance

qt and mysql connection QMYSQL driver is not even in the list of available drivers

Scheduled Pinned Locked Moved Unsolved General and Desktop
qmysqldatabase driverdatabases
6 Posts 4 Posters 1.5k 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.
  • B Offline
    B Offline
    Bogdan Onyshenko
    wrote on last edited by
    #1

    Hello all. I am back with an old topic about QMYSQL driver. I have an error driver doesn't load. But here is the list of available drivers from debug console.

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

    That is strange for me because in every forum topic and tutorials i have seeen it was present in the list. I tryed different tutorials even copying mysqllib.dll into windows folder but no result. Last I have tryed the steps from documentation.

    in sqldrivers/mysql folder:

    qmake -- MYSQL_INCDIR=C:/OSPanel/modules/database/MySQL-5.7-x64/include "MYSQL_LIBDIR=C:\OSPanel\modules\database\MySQL-5.7-x64/lib/"
    
    

    and then in sqldrivers folder

    mingw32-make sub-mysql  
    
    

    there I got an error no rules to make sub mysql. Also I have tryed to enable mysql using configure it gives an error that mysql enabled but library failed. What can I do about it? And sould be it matter if QMYSQL driver is epsont in driver list? I am using Win 10 x64. qt 5.12.0 and mingw730 x64. MySQL version 5.7 x64

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by Christian Ehrlicher
      #2

      As always (and mentioned many times here).
      Remove your qmake.cache and other stuff from sqldrivers subdir (and mysql subdir) and follow the instructions: https://doc.qt.io/qt-5/sql-driver.html#how-to-build-the-qmysql-plugin-on-unix-and-macos

      cd %QTDIR%\qtbase\src\plugins\sqldrivers
      qmake -- MYSQL_INCDIR=C:/MySQL/include "MYSQL_LIBDIR=C:/MYSQL/MySQL Server <version>/lib/opt"
      nmake sub-mysql
      

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      3
      • U Offline
        U Offline
        U7Development
        wrote on last edited by
        #3

        @Christian-Ehrlicher what do you mean by removing other stuffs from sqldrivers subdirectories ?.. do you mean to delete everything so this folder gets empty?

        JKSHJ Christian EhrlicherC 2 Replies Last reply
        0
        • U U7Development

          @Christian-Ehrlicher what do you mean by removing other stuffs from sqldrivers subdirectories ?.. do you mean to delete everything so this folder gets empty?

          JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by JKSH
          #4

          @U7Development said in qt and mysql connection QMYSQL driver is not even in the list of available drivers:

          what do you mean by removing other stuffs from sqldrivers subdirectories ?.. do you mean to delete everything so this folder gets empty?

          He meant: Delete all the files that were generated by a previous configuration/build. the sqldrivers folder (and all its subfolders) should only contain the files from the source code package.

          there I got an error no rules to make sub mysql.

          Pay attention to the output when you run qmake. If it can't find MySQL, it will say so there.

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          U 1 Reply Last reply
          5
          • U U7Development

            @Christian-Ehrlicher what do you mean by removing other stuffs from sqldrivers subdirectories ?.. do you mean to delete everything so this folder gets empty?

            Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @U7Development As said at least three times to you already: follow the instructions!

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            0
            • JKSHJ JKSH

              @U7Development said in qt and mysql connection QMYSQL driver is not even in the list of available drivers:

              what do you mean by removing other stuffs from sqldrivers subdirectories ?.. do you mean to delete everything so this folder gets empty?

              He meant: Delete all the files that were generated by a previous configuration/build. the sqldrivers folder (and all its subfolders) should only contain the files from the source code package.

              there I got an error no rules to make sub mysql.

              Pay attention to the output when you run qmake. If it can't find MySQL, it will say so there.

              U Offline
              U Offline
              U7Development
              wrote on last edited by
              #6

              @JKSH thanks

              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