Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How to load QMYSQL driver using Qt 5.12 in Visual Studio?
Forum Updated to NodeBB v4.3 + New Features

How to load QMYSQL driver using Qt 5.12 in Visual Studio?

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
7 Posts 3 Posters 1.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.
  • A Offline
    A Offline
    Aliwiki
    wrote on last edited by
    #1

    I have been searching for this answer all along the forum and there is no answer working for me.

    I am trying to follow this post of the Qt documentation.

    • I do have the MySql Server 8.0 installed and inside it's folder I can find the libmysql.dll. There are the include and lib folders the ask for also.
    • I also installed the C++ Connector, but there is nothing I can relate to what they ask me to do.
    • I did go to the: <QTDIR>/5.12.6/msvc2017_64/plugins/sqldrivers and tried to execute the qmake they say but it doesn't work (it shows the usage help).

    I do not know how to follow.

    1. Is it important that I am using Visual Studio instead of Qt Creator for this issue?
    2. What am I doing wrong with the qmake? Is the Qt documentation correct?

    Thank you!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Any chance that you did not download the Qt sources matching your version ?

      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
      0
      • A Offline
        A Offline
        Aliwiki
        wrote on last edited by
        #3

        @SGaist said in How to load QMYSQL driver using Qt 5.12 in Visual Studio?:

        Qt sources

        What do you mena with the sources? I did download the QT 5.12.6 version and I have already run some small apps using it.

        SGaistS 1 Reply Last reply
        0
        • Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Aliwiki said in How to load QMYSQL driver using Qt 5.12 in Visual Studio?:

          I did download the QT 5.12.6

          5.12.6. does not provide a pre-build Qt mysql plugin anymore, you have to compile it by yourself: https://doc.qt.io/qt-5/sql-driver.html

          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
          1
          • A Aliwiki

            @SGaist said in How to load QMYSQL driver using Qt 5.12 in Visual Studio?:

            Qt sources

            What do you mena with the sources? I did download the QT 5.12.6 version and I have already run some small apps using it.

            SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Aliwiki said in How to load QMYSQL driver using Qt 5.12 in Visual Studio?:

            @SGaist said in How to load QMYSQL driver using Qt 5.12 in Visual Studio?:

            Qt sources

            What do you mena with the sources? I did download the QT 5.12.6 version and I have already run some small apps using it.

            That's Qt pre-compiled for you. In order to compile the module you have to download the sources.

            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
            1
            • A Offline
              A Offline
              Aliwiki
              wrote on last edited by
              #6

              OK, I did understand I was not using the Qt sources and that was why the qmake didn't make sense. Now, I tried to execute it in the correct directory and I had this error:

              C:\Qt\5.12.6\Src\qtbase\src\plugins\sqldrivers> qmake -- MYSQL_INCDIR="C:\Program Files\MySQL\MySQL Server 8.0\include" MYSQL_LIBDIR="C:\Program Files\MySQL\MySQL Server 8.0\lib"
              Project ERROR: Cannot run compiler 'cl'. Output:
              ===================
              ===================
              Maybe you forgot to setup the environment?
              

              What am I doing wrong now?

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

                @Aliwiki said in How to load QMYSQL driver using Qt 5.12 in Visual Studio?:

                What am I doing wrong now?

                Maybe you forgot to setup the environment?

                Isn't this hint enough? You did not properly set up you compiler environment but simply opened cmd.exe instead the visual studio command prompt.

                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
                1

                • Login

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