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. build MySQL driver on ubuntu 18.04
QtWS25 Last Chance

build MySQL driver on ubuntu 18.04

Scheduled Pinned Locked Moved Unsolved General and Desktop
qsqlubuntu 18.04
10 Posts 4 Posters 1.3k 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.
  • H Offline
    H Offline
    hobbyProgrammer
    wrote on last edited by
    #1

    I tried to follow the documentation, but my header files and my .so files are in two different directories.

    I have my header files in:
    /usr/include/mysql

    I have my .so files in:
    usr/lib/x86_64-linux-gnu

    I already tried:

    cd $QTDIR/qtbase/src/plugins/sqldrivers
    qmake -- MYSQL_PREFIX=/usr/include/mysql
    
    Running configuration tests...
    Done running configuration tests.
    
    Configure summary:
    
    Qt Sql Drivers:
      DB2 (IBM) .............................. yes
      InterBase .............................. yes
      MySql .................................. no
      OCI (Oracle) ........................... yes
      ODBC ................................... no
      PostgreSQL ............................. no
      SQLite2 ................................ yes
      SQLite ................................. yes
        Using system provided SQLite ......... no
      TDS (Sybase) ........................... no
    
    Qt is now configured for building. Just run 'make'.
    Once everything is built, Qt is installed.
    You should NOT run 'make install'.
    Note that this build cannot be deployed to other machines or devices.
    
    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.
    

    and

    cd $QTDIR/qtbase/src/plugins/sqldrivers
    qmake -- MYSQL_PREFIX=/usr/lib/x86_64-linux-gnu
    
    Running configuration tests...
    Done running configuration tests.
    
    Configure summary:
    
    Qt Sql Drivers:
      DB2 (IBM) .............................. yes
      InterBase .............................. yes
      MySql .................................. no
      OCI (Oracle) ........................... yes
      ODBC ................................... no
      PostgreSQL ............................. no
      SQLite2 ................................ yes
      SQLite ................................. yes
        Using system provided SQLite ......... no
      TDS (Sybase) ........................... no
    
    Qt is now configured for building. Just run 'make'.
    Once everything is built, Qt is installed.
    You should NOT run 'make install'.
    Note that this build cannot be deployed to other machines or devices.
    
    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.
    
    

    both failed to work for me.

    I have absolutely no clue how to install these drivers, can someone please help me?

    jsulmJ JonBJ 2 Replies Last reply
    0
    • H hobbyProgrammer

      I tried to follow the documentation, but my header files and my .so files are in two different directories.

      I have my header files in:
      /usr/include/mysql

      I have my .so files in:
      usr/lib/x86_64-linux-gnu

      I already tried:

      cd $QTDIR/qtbase/src/plugins/sqldrivers
      qmake -- MYSQL_PREFIX=/usr/include/mysql
      
      Running configuration tests...
      Done running configuration tests.
      
      Configure summary:
      
      Qt Sql Drivers:
        DB2 (IBM) .............................. yes
        InterBase .............................. yes
        MySql .................................. no
        OCI (Oracle) ........................... yes
        ODBC ................................... no
        PostgreSQL ............................. no
        SQLite2 ................................ yes
        SQLite ................................. yes
          Using system provided SQLite ......... no
        TDS (Sybase) ........................... no
      
      Qt is now configured for building. Just run 'make'.
      Once everything is built, Qt is installed.
      You should NOT run 'make install'.
      Note that this build cannot be deployed to other machines or devices.
      
      Prior to reconfiguration, make sure you remove any leftovers from
      the previous build.
      

      and

      cd $QTDIR/qtbase/src/plugins/sqldrivers
      qmake -- MYSQL_PREFIX=/usr/lib/x86_64-linux-gnu
      
      Running configuration tests...
      Done running configuration tests.
      
      Configure summary:
      
      Qt Sql Drivers:
        DB2 (IBM) .............................. yes
        InterBase .............................. yes
        MySql .................................. no
        OCI (Oracle) ........................... yes
        ODBC ................................... no
        PostgreSQL ............................. no
        SQLite2 ................................ yes
        SQLite ................................. yes
          Using system provided SQLite ......... no
        TDS (Sybase) ........................... no
      
      Qt is now configured for building. Just run 'make'.
      Once everything is built, Qt is installed.
      You should NOT run 'make install'.
      Note that this build cannot be deployed to other machines or devices.
      
      Prior to reconfiguration, make sure you remove any leftovers from
      the previous build.
      
      

      both failed to work for me.

      I have absolutely no clue how to install these drivers, can someone please help me?

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

      @hobbyProgrammer Check configure log to see what is missing

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

      H 1 Reply Last reply
      1
      • H hobbyProgrammer

        I tried to follow the documentation, but my header files and my .so files are in two different directories.

        I have my header files in:
        /usr/include/mysql

        I have my .so files in:
        usr/lib/x86_64-linux-gnu

        I already tried:

        cd $QTDIR/qtbase/src/plugins/sqldrivers
        qmake -- MYSQL_PREFIX=/usr/include/mysql
        
        Running configuration tests...
        Done running configuration tests.
        
        Configure summary:
        
        Qt Sql Drivers:
          DB2 (IBM) .............................. yes
          InterBase .............................. yes
          MySql .................................. no
          OCI (Oracle) ........................... yes
          ODBC ................................... no
          PostgreSQL ............................. no
          SQLite2 ................................ yes
          SQLite ................................. yes
            Using system provided SQLite ......... no
          TDS (Sybase) ........................... no
        
        Qt is now configured for building. Just run 'make'.
        Once everything is built, Qt is installed.
        You should NOT run 'make install'.
        Note that this build cannot be deployed to other machines or devices.
        
        Prior to reconfiguration, make sure you remove any leftovers from
        the previous build.
        

        and

        cd $QTDIR/qtbase/src/plugins/sqldrivers
        qmake -- MYSQL_PREFIX=/usr/lib/x86_64-linux-gnu
        
        Running configuration tests...
        Done running configuration tests.
        
        Configure summary:
        
        Qt Sql Drivers:
          DB2 (IBM) .............................. yes
          InterBase .............................. yes
          MySql .................................. no
          OCI (Oracle) ........................... yes
          ODBC ................................... no
          PostgreSQL ............................. no
          SQLite2 ................................ yes
          SQLite ................................. yes
            Using system provided SQLite ......... no
          TDS (Sybase) ........................... no
        
        Qt is now configured for building. Just run 'make'.
        Once everything is built, Qt is installed.
        You should NOT run 'make install'.
        Note that this build cannot be deployed to other machines or devices.
        
        Prior to reconfiguration, make sure you remove any leftovers from
        the previous build.
        
        

        both failed to work for me.

        I have absolutely no clue how to install these drivers, can someone please help me?

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @hobbyProgrammer
        Before you head down this route, are you aware that Ubuntu 18.04 has apt-gettable MySQL support with Qt without any compiling at all? That would be against the Qt version also supplied for Ubuntu 18.04. So are you wanting to compile either of these because you want to make changes or want later versions than those supplied?

        H 1 Reply Last reply
        1
        • jsulmJ jsulm

          @hobbyProgrammer Check configure log to see what is missing

          H Offline
          H Offline
          hobbyProgrammer
          wrote on last edited by
          #4

          @jsulm my config.log contains:

          command line:
          

          and that's all

          1 Reply Last reply
          0
          • JonBJ JonB

            @hobbyProgrammer
            Before you head down this route, are you aware that Ubuntu 18.04 has apt-gettable MySQL support with Qt without any compiling at all? That would be against the Qt version also supplied for Ubuntu 18.04. So are you wanting to compile either of these because you want to make changes or want later versions than those supplied?

            H Offline
            H Offline
            hobbyProgrammer
            wrote on last edited by
            #5

            @JonB Hi,

            I don't really understand what you mean.
            I was not aware that Ubuntu 18.04 has apt-get table MySQL support without compiling. What would that mean for my MySQL/Qt connection?

            All I want is a database connection between MySQL and Qt on my Ubuntu vmware.

            JonBJ 1 Reply Last reply
            0
            • H hobbyProgrammer

              @JonB Hi,

              I don't really understand what you mean.
              I was not aware that Ubuntu 18.04 has apt-get table MySQL support without compiling. What would that mean for my MySQL/Qt connection?

              All I want is a database connection between MySQL and Qt on my Ubuntu vmware.

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #6

              @hobbyProgrammer
              That's why I was asking why/whether you wanted to go down the compile Qt stuff route.

              Let's start from basics. You have Qt on your 18.04. Did you fetch that via apt-get, or did you get the sources and compile Qt? Note that I am asking about Qt only, not MySQL support.

              H 1 Reply Last reply
              0
              • JonBJ JonB

                @hobbyProgrammer
                That's why I was asking why/whether you wanted to go down the compile Qt stuff route.

                Let's start from basics. You have Qt on your 18.04. Did you fetch that via apt-get, or did you get the sources and compile Qt? Note that I am asking about Qt only, not MySQL support.

                H Offline
                H Offline
                hobbyProgrammer
                wrote on last edited by
                #7

                @JonB i installed qt using this tutorial:

                https://wiki.qt.io/Install_Qt_5_on_Ubuntu

                so using wget

                JonBJ jsulmJ 2 Replies Last reply
                0
                • H hobbyProgrammer

                  @JonB i installed qt using this tutorial:

                  https://wiki.qt.io/Install_Qt_5_on_Ubuntu

                  so using wget

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by JonB
                  #8

                  @hobbyProgrammer
                  The stuff there was for Qt 5.7 & Ubuntu 12.10. It warns you that it's not good for later versions of Ubuntu. Personally I would not have done it that way, but experts here may say it's fine.

                  Furthermore, although you don't tell me, it sounds like that way led to fetching Qt sources and compiling Qt? I never do it that way. I don't have the sources, I have never compiled anything, I only do stuff via what's available from apt-get, ready-built.

                  It says:

                  Visit Qt downloads page an download a 32-bit or 64-bit Linux installation depending your version of Ubuntu.

                  That means, you did not apt-get the version from the repository for Ubuntu 18.04, you got whatever was current from Qt. In which case, I do not think you can reliably mix your Qt build with the apt-get for Qt MySQL support.

                  If you want further help I think I must butt out and leave experts to explain to you how best to proceed from here.

                  1 Reply Last reply
                  2
                  • H hobbyProgrammer

                    @JonB i installed qt using this tutorial:

                    https://wiki.qt.io/Install_Qt_5_on_Ubuntu

                    so using wget

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @hobbyProgrammer It is way easier to install Qt using apt-get as long as you do not need latest Qt version...

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

                    1 Reply Last reply
                    3
                    • mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      Hi
                      Just to make sure you understand.
                      When you install Qt from Qt site you get the normal version.
                      However, Unbuntu also allows you to use apt-get an Qt version. ( often Not the newest but close)
                      If you use that version, then you can also apt-get thd MySql stuff that is compiled with the unbuntu version of Qt.

                      So ifs not critical to use the absolute newest Qt then
                      Remove the version from Qt site
                      and apt-get Qt from ubuntu and the MySql Stuff and it should just work with no extra effort.

                      1 Reply Last reply
                      4

                      • Login

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