Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved MySQL driver on Windows 10

    General and Desktop
    3
    5
    627
    Loading More Posts
    • 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.
    • I
      Infinity last edited by

      First of all I have to mention that I'm not very familiar with Windows, but I have to compile my application on Windows 10. For this I installed MySQL Server 8.0 and Qt 5.13.1. Now I would like to build the mysql driver for Qt.

      Here is my mysql.pro:

      TARGET = qsqlmysql
      
      INCLUDEPATH += "C:/MySQL/MySQL Server 8.0/include"
      LIBS += -L"C:/MySQL/MySQL Server 8.0/lib"
      LIBS += -llibmysql
      
      HEADERS += $$PWD/qsql_mysql_p.h
      SOURCES += $$PWD/qsql_mysql.cpp $$PWD/main.cpp
      
      QMAKE_USE += mysql
      
      OTHER_FILES += mysql.json
      
      PLUGIN_CLASS_NAME = QMYSQLDriverPlugin
      include(../qsqldriverbase.pri)
      

      When I run qmake I get the following error:

      Project ERROR: Library 'mysql' is not defined.

      Here is the listing of the MySQL direcoty:

      07.09.2019  08:17    <DIR>          .
      07.09.2019  08:17    <DIR>          ..
      26.06.2019  21:19         7’101’952 http_auth_backend.dll
      26.06.2019  21:19         7’071’744 http_auth_realm.dll
      26.06.2019  21:19         7’353’344 http_server.dll
      26.06.2019  21:19            19’968 keepalive.dll
      26.06.2019  21:18         6’479’872 libmysql.dll
      26.06.2019  21:18            29’188 libmysql.lib
      07.09.2019  08:17    <DIR>          mecab
      26.06.2019  21:20         7’892’992 metadata_cache.dll
      26.06.2019  21:18        65’764’822 mysqlclient.lib
      26.06.2019  21:18            44’750 mysqlrouter_http.lib
      26.06.2019  21:19        22’951’984 mysqlrouter_lib.lib
      26.06.2019  21:19            90’624 mysql_protocol.dll
      07.09.2019  08:17    <DIR>          plugin
      26.06.2019  21:20         7’111’680 rest_api.dll
      26.06.2019  21:20         7’121’920 rest_metadata_cache.dll
      26.06.2019  21:20         7’096’320 rest_router.dll
      26.06.2019  21:20         7’140’864 rest_routing.dll
      26.06.2019  21:20         7’461’376 routing.dll
                    16 Datei(en),    160’733’400 Bytes
                     4 Verzeichnis(se), 120’553’926’656 Bytes frei
      
      c:\MySQL\MySQL Server 8.0\lib>
      

      What am I doing wrong here?

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        Looks like you are not following the Qt SQL drivers documentation, are you ?

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

        1 Reply Last reply Reply Quote 0
        • I
          Infinity last edited by

          I tried it, butthe directory C:/MYSQL/MySQL Server <version>/lib/opt does not exist on my Windows installation and I also got the message that %QTDIR%\qtbase\src\plugins\sqldrivers does not exist.

          I have Qt installed here:
          C:\Qt\5.13.1\Src\qtbase\src\plugins\sqldrivers/

          and MySQL here:
          C:\MySQL\MySQL Server 8.0\

          The libmysql.dll is in this directory:
          C:\MySQL\MySQL Server 8.0\lib\

          but there is no:
          C:\MySQL\MySQL Server 8.0\lib\opt

          How would the qmake command line look like with this setup?

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            You have to update the example given in the documentation to match what you have on your system.

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

            1 Reply Last reply Reply Quote 0
            • Jungkang65
              Jungkang65 Banned last edited by Jungkang65

              This post is deleted!
              1 Reply Last reply Reply Quote -1
              • First post
                Last post