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. Can't install the qmysql plugin in a Qt setup created using online installer

Can't install the qmysql plugin in a Qt setup created using online installer

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 4 Posters 777 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.
  • AritzA Offline
    AritzA Offline
    Aritz
    wrote on last edited by Aritz
    #1

    I'm running Qt 5.12.9 in an Ubuntu 18.04, installed it using the online installer wizard. I have selected all the components to install. However, when I want to use the Mysql plugin, it's not available:

    unknown: QSqlDatabase: QMYSQL driver not loaded
    unknown: QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7 QSQLCIPHER
    

    When Is -l the /usr/local/Qt/5.12.9/gcc_64/plugins/sqldrivers folder I see other plugins that the installer created:

    -rwxr-xr-x 1 root root 1280368 Jun 11  2020 libqsqlite.so
    -rwxr-xr-x 1 root root  119352 Jun 11  2020 libqsqlodbc.so
    -rwxr-xr-x 1 root root  112440 Jun 11  2020 libqsqlpsql.so
    

    However, the libqmysql.so file isn't being created. Reading the docs, it seems I need to do a qmake in this directory to create it, but shouldn't a .pro file be required for this? Do I need to build the whole qt project for this instead of using the installer?

    jsulmJ 1 Reply Last reply
    0
    • AritzA Aritz

      I'm running Qt 5.12.9 in an Ubuntu 18.04, installed it using the online installer wizard. I have selected all the components to install. However, when I want to use the Mysql plugin, it's not available:

      unknown: QSqlDatabase: QMYSQL driver not loaded
      unknown: QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7 QSQLCIPHER
      

      When Is -l the /usr/local/Qt/5.12.9/gcc_64/plugins/sqldrivers folder I see other plugins that the installer created:

      -rwxr-xr-x 1 root root 1280368 Jun 11  2020 libqsqlite.so
      -rwxr-xr-x 1 root root  119352 Jun 11  2020 libqsqlodbc.so
      -rwxr-xr-x 1 root root  112440 Jun 11  2020 libqsqlpsql.so
      

      However, the libqmysql.so file isn't being created. Reading the docs, it seems I need to do a qmake in this directory to create it, but shouldn't a .pro file be required for this? Do I need to build the whole qt project for this instead of using the installer?

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @Aritz said in Can't install the qmysql plugin in a Qt setup created using online installer:

      Reading the docs, it seems I need to do a qmake in this directory

      You need to do it in source code directory for QMysql driver. Follow https://doc.qt.io/qt-5/sql-driver.html ("Compile only a specific sql driver").

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • AritzA Offline
        AritzA Offline
        Aritz
        wrote on last edited by Aritz
        #3

        I see, but when I run either qmake -- MYSQL_PREFIX=/usr/local or qmake -- MYSQL_PREFIX=/usr/local/mysql in the sqldrivers folder I get:

        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
          -Wdeprecated   Turn on deprecation warnings (on by default)
        
        Options:
           * You can place any variable assignment in options and it will be *
           * processed as if it was in [files]. These assignments will be    *
           * processed before [files] by default.                            *
          -o file        Write output to file
          -d             Increase debug level
          -t templ       Overrides TEMPLATE as templ
          -tp prefix     Overrides TEMPLATE so that prefix is prefixed into the value
          -help          This help
          -v             Version information
          -early         All subsequent variable assignments will be
                         parsed right before default_pre.prf
          -before        All subsequent variable assignments will be
                         parsed right before [files] (the default)
          -after         All subsequent variable assignments will be
                         parsed after [files]
          -late          All subsequent variable assignments will be
                         parsed right after default_post.prf
          -norecursive   Don't do a recursive search
          -recursive     Do a recursive search
          -set <prop> <value> Set persistent property
          -unset <prop>  Unset persistent property
          -query <prop>  Query persistent property. Show all if <prop> is empty.
          -qtconf file   Use file instead of looking for qt.conf
          -cache file    Use file as cache           [makefile mode only]
          -spec spec     Use spec as QMAKESPEC       [makefile mode only]
          -nocache       Don't use a cache file      [makefile mode only]
          -nodepend      Don't generate dependencies [makefile mode only]
          -nomoc         Don't generate moc targets  [makefile mode only]
          -nopwd         Don't look for files in pwd [project mode only]
        
        
        AritzA 1 Reply Last reply
        0
        • AritzA Aritz

          I see, but when I run either qmake -- MYSQL_PREFIX=/usr/local or qmake -- MYSQL_PREFIX=/usr/local/mysql in the sqldrivers folder I get:

          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
            -Wdeprecated   Turn on deprecation warnings (on by default)
          
          Options:
             * You can place any variable assignment in options and it will be *
             * processed as if it was in [files]. These assignments will be    *
             * processed before [files] by default.                            *
            -o file        Write output to file
            -d             Increase debug level
            -t templ       Overrides TEMPLATE as templ
            -tp prefix     Overrides TEMPLATE so that prefix is prefixed into the value
            -help          This help
            -v             Version information
            -early         All subsequent variable assignments will be
                           parsed right before default_pre.prf
            -before        All subsequent variable assignments will be
                           parsed right before [files] (the default)
            -after         All subsequent variable assignments will be
                           parsed after [files]
            -late          All subsequent variable assignments will be
                           parsed right after default_post.prf
            -norecursive   Don't do a recursive search
            -recursive     Do a recursive search
            -set <prop> <value> Set persistent property
            -unset <prop>  Unset persistent property
            -query <prop>  Query persistent property. Show all if <prop> is empty.
            -qtconf file   Use file instead of looking for qt.conf
            -cache file    Use file as cache           [makefile mode only]
            -spec spec     Use spec as QMAKESPEC       [makefile mode only]
            -nocache       Don't use a cache file      [makefile mode only]
            -nodepend      Don't generate dependencies [makefile mode only]
            -nomoc         Don't generate moc targets  [makefile mode only]
            -nopwd         Don't look for files in pwd [project mode only]
          
          
          AritzA Offline
          AritzA Offline
          Aritz
          wrote on last edited by
          #4

          @Aritz Sorry just realized I'm not in source folder!

          1 Reply Last reply
          0
          • AritzA Offline
            AritzA Offline
            Aritz
            wrote on last edited by
            #5

            The sub rule still doesn't seem to be created:

            + cd /usr/local/Qt/5.12.9/Src/qtbase/src/plugins/sqldrivers
            + qmake -- MYSQL_PREFIX=/usr/local
            Info: creating stash file /usr/local/Qt/5.12.9/Src/qtbase/src/plugins/sqldrivers/.qmake.stash
            
            Done running configuration tests.
            
            Configure summary:
            
            Qt Sql Drivers:
              DB2 (IBM) .............................. no
              InterBase .............................. no
              MySql .................................. no
              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 '/usr/local/Qt/5.12.9/gcc_64'.
            
            Prior to reconfiguration, make sure you remove any leftovers from
            the previous build.
            
            + make sub-mysql
            make: *** No rule to make target 'sub-mysql'.  Stop.
            
            jsulmJ 1 Reply Last reply
            0
            • B Offline
              B Offline
              Bonnie
              wrote on last edited by
              #6

              As in the doc:

              here it is assumed that MySQL / MariaDB is installed in /usr/local

              So do you have the header and lib files there?

              1 Reply Last reply
              0
              • AritzA Aritz

                The sub rule still doesn't seem to be created:

                + cd /usr/local/Qt/5.12.9/Src/qtbase/src/plugins/sqldrivers
                + qmake -- MYSQL_PREFIX=/usr/local
                Info: creating stash file /usr/local/Qt/5.12.9/Src/qtbase/src/plugins/sqldrivers/.qmake.stash
                
                Done running configuration tests.
                
                Configure summary:
                
                Qt Sql Drivers:
                  DB2 (IBM) .............................. no
                  InterBase .............................. no
                  MySql .................................. no
                  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 '/usr/local/Qt/5.12.9/gcc_64'.
                
                Prior to reconfiguration, make sure you remove any leftovers from
                the previous build.
                
                + make sub-mysql
                make: *** No rule to make target 'sub-mysql'.  Stop.
                
                jsulmJ Online
                jsulmJ Online
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @Aritz Check the config.log file to see what exactly is the problem

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • AritzA Offline
                  AritzA Offline
                  Aritz
                  wrote on last edited by
                  #8

                  Thanks, it was libmysqlclient-dev not being installed at this point. ;-)

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

                    Hi,

                    One more thing, ensure that you are using the qmake executable matching your Qt version for which you want to build the driver for.

                    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

                    • Login

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