Results 1 to 5 of 5

Thread: compile mySQL plugin - mysql_config not found

  1. #1
    Join Date
    Jun 2012
    Location
    Austria
    Posts
    22
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Lightbulb compile mySQL plugin - mysql_config not found

    Dear all,
    I have to add mySQL / MariaDB support in an old 5.15.2 installation. As explained in https://doc.qt.io/qt-5/sql-driver.html#qmysql I have to compile the plugin myself. The problem is, that the qmake step does not recognize the mariaDB installation:
    Qt Code:
    1. user:/opt/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers$ qmake -- MYSQL_INCDIR="/usr/include/mariadb" MYSQL_LIBDIR="/lib/x86_64-linux-gnu"
    2.  
    3. Running configuration tests...
    4. Done running configuration tests.
    5.  
    6. Configure summary:
    7.  
    8. Qt Sql Drivers:
    9. DB2 (IBM) .............................. no
    10. InterBase .............................. no
    11. MySql .................................. no
    12. OCI (Oracle) ........................... no
    13. ODBC ................................... no
    14. PostgreSQL ............................. no
    15. SQLite2 ................................ no
    16. SQLite ................................. yes
    17. Using system provided SQLite ......... no
    18. TDS (Sybase) ........................... no
    19.  
    20. Qt is now configured for building. Just run 'make'.
    21. Once everything is built, you must run 'make install'.
    22. Qt will be installed into '/opt/Qt/5.15.2/gcc_64'.
    To copy to clipboard, switch view to plain text mode 

    Same result if I try
    Qt Code:
    1. qmake -- MYSQL_PREFIX=/usr/include/mariadb
    To copy to clipboard, switch view to plain text mode 
    . I am quite sure that mariaDB IS installed:
    Qt Code:
    1. user:/opt/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers$ ls /usr/include/mariadb/mysql*
    2. /usr/include/mariadb/mysql_com.h /usr/include/mariadb/mysqld_error.h /usr/include/mariadb/mysql.h /usr/include/mariadb/mysql_version.h
    3.  
    4. /usr/include/mariadb/mysql:
    5. client_plugin.h plugin_auth_common.h plugin_auth.h
    6. user:/opt/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers$ ls /lib/x86_64-linux-gnu/libmysql*
    7. /lib/x86_64-linux-gnu/libmysqlclient.so.21 /lib/x86_64-linux-gnu/libmysqlclient.so.21.2.31 /lib/x86_64-linux-gnu/libmysqlservices.a
    To copy to clipboard, switch view to plain text mode 

    It seems that qmake does not find any of the config-tests as config.log says - pay attention to line 8, 11, ... which says mysql_config not found.

    Qt Code:
    1. Command line:
    2. Global lib dirs: [/home/qt/openssl-1.1.1g/lib] [/usr/lib/gcc/x86_64-linux-gnu/9 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib]
    3. Global inc dirs: [/home/qt/openssl-1.1.1g/include] [/usr/include/c++/9 /usr/include/x86_64-linux-gnu/c++/9 /usr/include/c++/9/backward /usr/lib/gcc/x86_64-linux-gnu/9/include /usr/local/include /usr/include/x86_64-linux-gnu /usr/include]
    4. loaded result for library config.sqldrivers.libraries.db2
    5. ...
    6. loaded result for library config.sqldrivers.libraries.mysql
    7. Trying source 0 (type mysqlConfig) of library mysql ...
    8. mysql_config not found.
    9. => source produced no result.
    10. Trying source 1 (type mysqlConfig) of library mysql ...
    11. mysql_config not found.
    12. => source produced no result.
    13. Trying source 2 (type mysqlConfig) of library mysql ...
    14. mysql_config not found.
    15. => source produced no result.
    16. Trying source 3 (type mysqlConfig) of library mysql ...
    17. mysql_config not found.
    18. => source produced no result.
    19. Trying source 4 (type inline) of library mysql ...
    20. mysql.h not found in [] and global paths.
    21. => source produced no result.
    22. Trying source 5 (type inline) of library mysql ...
    23. => source failed condition 'config.win32'.
    24. Trying source 6 (type inline) of library mysql ...
    25. => source failed condition 'config.win32'.
    26. Trying source 7 (type inline) of library mysql ...
    27. mysql.h not found in [] and global paths.
    28. => source produced no result.
    29. Trying source 8 (type inline) of library mysql ...
    30. mysql.h not found in [] and global paths.
    31. => source produced no result.
    32. test config.sqldrivers.libraries.mysql FAILED
    33. loaded result for library config.sqldrivers.libraries.oci
    34. ...
    To copy to clipboard, switch view to plain text mode 

    I already removed the sources and re-installed them using the Maintenance tool. Did not help.
    1. Where should these tests be located?
    2. Can I force the mySQL build somehow?
    3. I think the include path has to point to mysql.h - correct?


    Any hint highly welcome.

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    503
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: compile mySQL plugin - mysql_config not found

    Hi, can you execute mysql_config directly from a command line?
    On my openSUSE system it is part of the libmariadb-devel package, maybe you are simply missing some package?

    Ginsengelf

  3. #3
    Join Date
    Jun 2012
    Location
    Austria
    Posts
    22
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: compile mySQL plugin - mysql_config not found

    Good hint, thanks.
    On ubuntu 20.04 the package seem be called libmariadb-dev. So yes, libmariadb-dev and libmariadbclient-dev are installed.
    Where is mysql_config on your system? Somehow I can't find it at all...


    Added after 7 minutes:


    UPDATE:
    A very ugly (although working) workaround is to tweak the mysql.pro in the mysql subfolder.
    I removed the QMAKE_USE += mysql and added INCLUDEPATH and LIBS pointing to the appropriate places. And viola it compiles, installs and is found at runtime.
    Still I would be highly interested in a clean solution.
    Last edited by stryga42; 17th November 2022 at 18:16.

  4. #4
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    503
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: compile mySQL plugin - mysql_config not found

    Hi,

    on my system it's in /usr/bin/mysql_config
    According to https://packages.ubuntu.com/search?s...s=mysql_config
    it should be part of libmysqlclient-dev on Ubuntu 20.04 (or libmariadb-dev-compat).

    Ginsengelf

  5. #5
    Join Date
    Jun 2012
    Location
    Austria
    Posts
    22
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: compile mySQL plugin - mysql_config not found

    Thanks for looking it up. Yes, you are right it is exactly there.
    I think I found the problem. Something screwed up the qtchooser setup and qmake executed in a partly invalid Qt environment. A simple export QT_SELECT="qt5.15.2" did the job. Now MySql (aka mariaDB) is recogized.


    Added after 4 minutes:


    Additional comment: I tried the same thing on another Ubuntu 20.04 machine with Qt5.15.2. There compile did work there but during runtime the plugin thinks that the DB does not support transactions. Very weired... I'll close this thread anyway. Thank's for your effort! (And, please Qt team, provide a precompiled mariaDB plugin :-) )
    Last edited by stryga42; 30th November 2022 at 20:53.

Similar Threads

  1. Cannot compile Qt 5.5 Opensource mysql plugin
    By MarkoSan in forum Installation and Deployment
    Replies: 1
    Last Post: 17th August 2015, 09:43
  2. Replies: 0
    Last Post: 14th September 2012, 20:46
  3. How to compile a mysql plugin in the QT 4.7 version?
    By wter27 in forum Qt Programming
    Replies: 0
    Last Post: 29th January 2011, 05:26
  4. Replies: 5
    Last Post: 25th September 2009, 15:03
  5. Too simple compile error to be found by me??!!!
    By MarkoSan in forum General Programming
    Replies: 6
    Last Post: 20th December 2007, 05:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.