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. MYSQL / QT issues
Forum Updated to NodeBB v4.3 + New Features

MYSQL / QT issues

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
20 Posts 4 Posters 1.5k 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #10

    Then, do you have that path in your PATH environment variable ? (Still in Qt Creator)

    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
    • J Offline
      J Offline
      Jdonoher
      wrote on last edited by
      #11

      There isnt one so Im guessing I add PATH as the variable and the value being the dir?

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

        PATH is already defined, you may have to check a checkbox on the Run panel in order to have access to it.

        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
        • J Offline
          J Offline
          Jdonoher
          wrote on last edited by Jdonoher
          #13

          Hi, I couldnt find the PATH variable but ran this command in main.cpp:
          QCoreApplication::addLibraryPath("C:\Program Files\MySQL");
          However this didnt change any of the logs. Im a bit lost with where to go from here

          JonBJ 1 Reply Last reply
          0
          • J Offline
            J Offline
            Jdonoher
            wrote on last edited by
            #14

            @SGaist I have also tried to compile driver using the following in the command prompt :
            C:\Qt\6.2.3\Src\qtbase\src\plugins\sqldrivers>qmake -version
            QMake version 3.1
            Using Qt version 6.2.3 in C:/Qt/6.2.3/mingw_64/lib

            C:\Qt\6.2.3\Src\qtbase\src\plugins\sqldrivers>qmake -- MYSQL_INCDIR="C:/Program Files/MySQL/MySQL Connector C 6.1/include" MYSQL_LIBDIR="C:/Program Files/MySQL/MySQL Connector C 6.1/lib"

            However it doesnt do anything after the second command, just gives me basic qmkae info.

            1 Reply Last reply
            0
            • J Jdonoher

              Hi, I couldnt find the PATH variable but ran this command in main.cpp:
              QCoreApplication::addLibraryPath("C:\Program Files\MySQL");
              However this didnt change any of the logs. Im a bit lost with where to go from here

              JonBJ Online
              JonBJ Online
              JonB
              wrote on last edited by
              #15

              @Jdonoher said in MYSQL / QT issues:

              QCoreApplication::addLibraryPath("C:\Program Files\MySQL");

              Did you really copy and paste this line from your C++ source code file? Please copy and paste whatever you have literally, do not type it in by hand.....

              J 1 Reply Last reply
              0
              • JonBJ JonB

                @Jdonoher said in MYSQL / QT issues:

                QCoreApplication::addLibraryPath("C:\Program Files\MySQL");

                Did you really copy and paste this line from your C++ source code file? Please copy and paste whatever you have literally, do not type it in by hand.....

                J Offline
                J Offline
                Jdonoher
                wrote on last edited by Jdonoher
                #16

                @JonB It was copied. 37a99e6e-416e-4722-92af-3a9718434e27-image.png

                I tired with'\' and '/' just in case but either way didnt help.

                1 Reply Last reply
                1
                • J Offline
                  J Offline
                  Jdonoher
                  wrote on last edited by Jdonoher
                  #17

                  I've alslo managed to finally get .pro file in my /mysql dir in src. However it cannot build, I have included the include path from the mysql connector as well as added the lib to LIBS. but am getting 3 errors: a81d5a34-9025-4850-8bb0-0dd7e548667f-image.png

                  Here is mysql.pro file:
                  3c368e2b-ab74-4539-b282-3e99497c3245-image.png

                  JonBJ 1 Reply Last reply
                  0
                  • J Jdonoher

                    I've alslo managed to finally get .pro file in my /mysql dir in src. However it cannot build, I have included the include path from the mysql connector as well as added the lib to LIBS. but am getting 3 errors: a81d5a34-9025-4850-8bb0-0dd7e548667f-image.png

                    Here is mysql.pro file:
                    3c368e2b-ab74-4539-b282-3e99497c3245-image.png

                    JonBJ Online
                    JonBJ Online
                    JonB
                    wrote on last edited by
                    #18

                    @Jdonoher
                    I could be wrong, but because your paths have spaces in them I would have expected them to need to be quoted, like:

                    INCLUDEPATH += "C:/Program Files/MySQl/MySQL Connector C 6.1/include"
                    LIBS += "C:/Program Files/MySQl/MySQL Connector C 6.1/lib"
                    
                    J 1 Reply Last reply
                    1
                    • JonBJ JonB

                      @Jdonoher
                      I could be wrong, but because your paths have spaces in them I would have expected them to need to be quoted, like:

                      INCLUDEPATH += "C:/Program Files/MySQl/MySQL Connector C 6.1/include"
                      LIBS += "C:/Program Files/MySQl/MySQL Connector C 6.1/lib"
                      
                      J Offline
                      J Offline
                      Jdonoher
                      wrote on last edited by
                      #19

                      @JonB yeah Ive tried both ways multiple times and still errors, strangely I get more build errors with quotes than without but quotes certainly feel necessary

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

                        Simply move it to a folder without spaces...

                        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

                        • Login

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