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. QMYSQL Plug in MAC OS 10.15.4 Catalina
QtWS25 Last Chance

QMYSQL Plug in MAC OS 10.15.4 Catalina

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 688 Views
  • 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.
  • E Offline
    E Offline
    EdBatt
    wrote on last edited by
    #1

    I have been working my way diligently through all the QT Tutorials I can find, and so far very impressed with what can be achieved. However I now need to start with databases, and starting out wiht MYSQL.

    I have no come across the famous:
    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7

    I am working on a MAC with OS 10.15.4 Catalina
    QT5.14.2 (Open Source Licence)
    MYSQL 8.0.19

    I have installed Connector/C++ 8.0.19 as per the instructions provided at https://doc.qt.io/qt-5/sql-driver.html

    Following the same set of instructions I execute the following in the terminal window:

    cd /Users/Edward/Qt/5.14.2/clang_64/plugins/sqldrivers
    qmake -- MYSQL_PREFIX=/usr/local
    make sub-mysql

    The first line of the above is modified to suit my installation location, the remainder is as per the example provided on the website.
    However when I execute:
    qmake -- MYSQL_PREFIX=/usr/local

    I get the following response:

    Usage: qmake [mode] [options] [files]

    QMake has two modes, one mode for generating project files based on
    some heuristics, and the other for generating makefiles. Normally you
    shouldn't need to specify a mode, as makefile generation is the default
    mode for qmake, but you may use this to test qmake on an existing project...
    followed be all the options available.
    If I then execite the final line of:
    make sub-mysql

    I get the following response:

    make: *** No rule to make target `sub-mysql'. Stop.

    I have searched high and low for a solution to this problem, however none of the posting I found have helped me to resolve this problem.

    Additional information.
    I used the QT online installer.
    I uninstalled and downloaded source and tried to compile from source, there were so many errors in this process I decided to uninstall and do a clean install using the online installer again.

    My installation folders for all key elements are as follows:

    /Users/Edward/Qt/5.14.2/clang_64/plugins/sqldrivers
    /usr/local/mysql-8.0.19-macos10.15-x86_64
    /usr/local/mysql-connector-c++-8.0.19

    I am on a steep learning curve, and doing my best to work my way through the forums and anywhere else I can find potential solution, but after three day of beating my head against the wall I would greatly appreciate if anyone can give me some guidance in layman terms so I an understand what I am doing wrong and fix the problem.

    My thanks in advance to anyone who can help.

    1 Reply Last reply
    0
    • E Offline
      E Offline
      EdBatt
      wrote on last edited by
      #4

      Finally resolved this issue thanks to this post:
      https://forum.qt.io/topic/106565/mysql-qt-create-plugin-mysql-for-qt-on-mac

      Followed the instructions in this post step by step and it worked perfectly, I was missing the last step in the process...editing the environment to include the modified path.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Bonnie
        wrote on last edited by Bonnie
        #2

        I don't use MAC but I think you should run qmake under Src\qtbase\src\plugins\sqldrivers if you have installed the source with Qt
        I mean there is no code in Qt/5.14.2/clang_64/plugins

        1 Reply Last reply
        1
        • E Offline
          E Offline
          EdBatt
          wrote on last edited by
          #3

          @EdBatt said in QMYSQL Plug in MAC OS 10.15.4 Catalina:
          Bonnie,
          Thanks for taking time to try and help me, and my apologies for not responding sooner... for some reason I am not getting post notifications.

          I did as you suggested and although it appeared to work i am still getting the following in the console:
          QSqlDatabase: QMYSQL driver not loaded
          QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7

          The following is the first part of the output from the terminal when running the commands:
          iMac:~ Edward$ cd /Users/Edward/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers
          iMac:sqldrivers Edward$ qmake -- MYSQL_PREFIX=/usr/local
          Info: creating stash file /Users/Edward/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/.qmake.stash

          Running configuration tests...
          Checking for DB2 (IBM)... no
          Checking for InterBase... no
          Checking for MySQL... yes
          Checking for OCI (Oracle)... no
          Checking for ODBC... no
          Checking for PostgreSQL... no
          Checking for SQLite (version 2)... no
          Checking for TDS (Sybase)... no
          Done running configuration tests.

          Configure summary:

          Qt Sql Drivers:
          DB2 (IBM) .............................. no
          InterBase .............................. no
          MySql .................................. yes
          OCI (Oracle) ........................... no
          ODBC ................................... no
          PostgreSQL ............................. no
          SQLite2 ................................ no
          SQLite ................................. yes
          Using system provided SQLite ......... no
          TDS (Sybase) ........................... no

          Qt is now configured for building. Just run 'make'.
          Once everything is built, you must run 'make install'.
          Qt will be installed into '/Users/Edward/Qt/5.14.2/clang_64'.

          Prior to reconfiguration, make sure you remove any leftovers from
          the previous build.

          I am not sure that it will make any difference, however instead of running just make sub-mysql I am going to try make install

          I will let you know if that fixes anything, but somehow I doubt it as I have tried that before. I assume the SDK is installed with the online installer. Unfortunately for some reason it is very difficult to access any of QT downloads in my region. It can take days just to get access to the online installer.

          1 Reply Last reply
          0
          • E Offline
            E Offline
            EdBatt
            wrote on last edited by
            #4

            Finally resolved this issue thanks to this post:
            https://forum.qt.io/topic/106565/mysql-qt-create-plugin-mysql-for-qt-on-mac

            Followed the instructions in this post step by step and it worked perfectly, I was missing the last step in the process...editing the environment to include the modified path.

            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