Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [SOLVED] QSqlDatabase: QMYSQL driver not loaded
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] QSqlDatabase: QMYSQL driver not loaded

Scheduled Pinned Locked Moved Qt Creator and other tools
6 Posts 2 Posters 14.2k 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.
  • T Offline
    T Offline
    topson128
    wrote on last edited by
    #1

    Dear all,

    I followed these steps to build QMYSQL driver:

    @cd %QTDIR%\src\plugins\sqldrivers\mysql
    qmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\lib\libmysql.lib" mysql.pro
    nmake
    copy C:\MYSQL\lib\libmysql.dll %QTDIR%\bin@

    But I still got the error:
    QSqlDatabase: QMYSQL driver not loaded

    Could you please help me how to fix this issue?

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      Has the resulting library been placed in the plugins/sqldrivers directory?

      1 Reply Last reply
      0
      • T Offline
        T Offline
        topson128
        wrote on last edited by
        #3

        Dear Lukas Geyer,

        Yes, the following files are modified in /plugins/sqldrivers directory:

        • qsqlmysql.lib
        • qsqlmysql.prl

        Are there any files I miss?

        Thank you for your response.

        [quote author="Lukas Geyer" date="1343370474"]Has the resulting library been placed in the plugins/sqldrivers directory?[/quote]

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          qsqlmysql4.dll resp. qsqlmysql4d.dll

          1 Reply Last reply
          0
          • T Offline
            T Offline
            topson128
            wrote on last edited by
            #5

            Dear Lukas Geyer,

            Thank you for your instruction.
            This issue is solved now.

            I guess I use wrong "include & lib" path with MySQL Server,
            I change to use Connector C (Client?) "include & lib" path and do the same like before.
            Now, I can use QMYSQL.

            Thank you very much.

            [quote author="Lukas Geyer" date="1343374724"]qsqlmysql4.dll resp. qsqlmysql4d.dll[/quote]

            1 Reply Last reply
            0
            • L Offline
              L Offline
              lgeyer
              wrote on last edited by
              #6

              You're welcome.

              And just for the sake of beeing a nitpick: there is a typo in your -[SLOVED]- [SOLVED].

              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