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. MySQL database
Qt 6.11 is out! See what's new in the release blog

MySQL database

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 2.4k Views 2 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.
  • collycrkC Offline
    collycrkC Offline
    collycrk
    wrote on last edited by
    #1

    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
    My working MySQL database has started giving me the above error. I do not understand how the database is not loading the driver as it is plainly in sight.
    Anyone have any thoughts on how to correct this? Thanks in advance.

    How to print a dialog in Qt seems to be beyond my comprehension. Would you like to teach me this one skill. If so, lets talk!

    K 1 Reply Last reply
    0
    • collycrkC Offline
      collycrkC Offline
      collycrk
      wrote on last edited by
      #7

      The solution for the QMYSQL not being loaded was the environment path variable needed to point to the lib folder.
      In my case it is C:/MySqlDB/lib

      How to print a dialog in Qt seems to be beyond my comprehension. Would you like to teach me this one skill. If so, lets talk!

      1 Reply Last reply
      0
      • VRoninV Offline
        VRoninV Offline
        VRonin
        wrote on last edited by VRonin
        #2

        What OS are you on?

        This is a question that has been solved numerous times for different OSs https://www.google.co.uk/search?q="QMYSQL+driver+not+loaded"+site%3Aforum.qt.io

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        1 Reply Last reply
        2
        • collycrkC collycrk

          QSqlDatabase: QMYSQL driver not loaded
          QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
          My working MySQL database has started giving me the above error. I do not understand how the database is not loading the driver as it is plainly in sight.
          Anyone have any thoughts on how to correct this? Thanks in advance.

          K Offline
          K Offline
          koahnig
          wrote on last edited by
          #3

          @collycrk

          Do you have MySQL installed and linked with the mysql lib?
          Under windows in most cases the dll for mySQL is not accesible by the application.

          Vote the answer(s) that helped you to solve your issue(s)

          collycrkC 1 Reply Last reply
          2
          • collycrkC Offline
            collycrkC Offline
            collycrk
            wrote on last edited by
            #4

            OS is windows;
            Here is the connection I am using.
            mydb = QSqlDatabase::addDatabase("QMYSQL");
            mydb.setHostName("127.0.0.1");
            mydb.setDatabaseName("ccs");
            mydb.setUserName("ccs");
            mydb.setPassword("xxxxxxxxxxx"); set with the real password of course

            How to print a dialog in Qt seems to be beyond my comprehension. Would you like to teach me this one skill. If so, lets talk!

            1 Reply Last reply
            0
            • K koahnig

              @collycrk

              Do you have MySQL installed and linked with the mysql lib?
              Under windows in most cases the dll for mySQL is not accesible by the application.

              collycrkC Offline
              collycrkC Offline
              collycrk
              wrote on last edited by
              #5

              @koahnig
              The connection has been working for a couple of months already. Just now not connecting.

              How to print a dialog in Qt seems to be beyond my comprehension. Would you like to teach me this one skill. If so, lets talk!

              K 1 Reply Last reply
              0
              • collycrkC collycrk

                @koahnig
                The connection has been working for a couple of months already. Just now not connecting.

                K Offline
                K Offline
                koahnig
                wrote on last edited by
                #6

                @collycrk

                Probably you need to check if the dll is still where you/the application expect(s) it. Typically a change of folders for the application is creating such problems. All that depends on your setup.

                Did you check out the link provided by @VRonin ?

                Vote the answer(s) that helped you to solve your issue(s)

                1 Reply Last reply
                0
                • collycrkC Offline
                  collycrkC Offline
                  collycrk
                  wrote on last edited by
                  #7

                  The solution for the QMYSQL not being loaded was the environment path variable needed to point to the lib folder.
                  In my case it is C:/MySqlDB/lib

                  How to print a dialog in Qt seems to be beyond my comprehension. Would you like to teach me this one skill. If so, lets talk!

                  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