Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

build MySQL driver on ubuntu 18.04



  • 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?


  • Lifetime Qt Champion

    @hobbyProgrammer Check configure log to see what is missing



  • @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?



  • @jsulm my config.log contains:

    command line:
    

    and that's all



  • @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.



  • @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.



  • @JonB i installed qt using this tutorial:

    https://wiki.qt.io/Install_Qt_5_on_Ubuntu

    so using wget



  • @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.


  • Lifetime Qt Champion

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


  • Lifetime Qt Champion

    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.


Log in to reply