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:
user:/opt/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers$ qmake -- MYSQL_INCDIR="/usr/include/mariadb" MYSQL_LIBDIR="/lib/x86_64-linux-gnu"
Running configuration tests...
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 '/opt/Qt/5.15.2/gcc_64'.
user:/opt/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers$ qmake -- MYSQL_INCDIR="/usr/include/mariadb" MYSQL_LIBDIR="/lib/x86_64-linux-gnu"
Running configuration tests...
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 '/opt/Qt/5.15.2/gcc_64'.
To copy to clipboard, switch view to plain text mode
Same result if I try
qmake -- MYSQL_PREFIX=/usr/include/mariadb
qmake -- MYSQL_PREFIX=/usr/include/mariadb
To copy to clipboard, switch view to plain text mode
. I am quite sure that mariaDB IS installed:
user:/opt/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers$ ls /usr/include/mariadb/mysql*
/usr/include/mariadb/mysql_com.h /usr/include/mariadb/mysqld_error.h /usr/include/mariadb/mysql.h /usr/include/mariadb/mysql_version.h
/usr/include/mariadb/mysql:
client_plugin.h plugin_auth_common.h plugin_auth.h
user:/opt/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers$ ls /lib/x86_64-linux-gnu/libmysql*
/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
user:/opt/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers$ ls /usr/include/mariadb/mysql*
/usr/include/mariadb/mysql_com.h /usr/include/mariadb/mysqld_error.h /usr/include/mariadb/mysql.h /usr/include/mariadb/mysql_version.h
/usr/include/mariadb/mysql:
client_plugin.h plugin_auth_common.h plugin_auth.h
user:/opt/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers$ ls /lib/x86_64-linux-gnu/libmysql*
/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.
Command line:
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]
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]
loaded result for library config.sqldrivers.libraries.db2
...
loaded result for library config.sqldrivers.libraries.mysql
Trying source 0 (type mysqlConfig) of library mysql ...
mysql_config not found.
=> source produced no result.
Trying source 1 (type mysqlConfig) of library mysql ...
mysql_config not found.
=> source produced no result.
Trying source 2 (type mysqlConfig) of library mysql ...
mysql_config not found.
=> source produced no result.
Trying source 3 (type mysqlConfig) of library mysql ...
mysql_config not found.
=> source produced no result.
Trying source 4 (type inline) of library mysql ...
mysql.h not found in [] and global paths.
=> source produced no result.
Trying source 5 (type inline) of library mysql ...
=> source failed condition 'config.win32'.
Trying source 6 (type inline) of library mysql ...
=> source failed condition 'config.win32'.
Trying source 7 (type inline) of library mysql ...
mysql.h not found in [] and global paths.
=> source produced no result.
Trying source 8 (type inline) of library mysql ...
mysql.h not found in [] and global paths.
=> source produced no result.
test config.sqldrivers.libraries.mysql FAILED
loaded result for library config.sqldrivers.libraries.oci
...
Command line:
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]
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]
loaded result for library config.sqldrivers.libraries.db2
...
loaded result for library config.sqldrivers.libraries.mysql
Trying source 0 (type mysqlConfig) of library mysql ...
mysql_config not found.
=> source produced no result.
Trying source 1 (type mysqlConfig) of library mysql ...
mysql_config not found.
=> source produced no result.
Trying source 2 (type mysqlConfig) of library mysql ...
mysql_config not found.
=> source produced no result.
Trying source 3 (type mysqlConfig) of library mysql ...
mysql_config not found.
=> source produced no result.
Trying source 4 (type inline) of library mysql ...
mysql.h not found in [] and global paths.
=> source produced no result.
Trying source 5 (type inline) of library mysql ...
=> source failed condition 'config.win32'.
Trying source 6 (type inline) of library mysql ...
=> source failed condition 'config.win32'.
Trying source 7 (type inline) of library mysql ...
mysql.h not found in [] and global paths.
=> source produced no result.
Trying source 8 (type inline) of library mysql ...
mysql.h not found in [] and global paths.
=> source produced no result.
test config.sqldrivers.libraries.mysql FAILED
loaded result for library config.sqldrivers.libraries.oci
...
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.
- Where should these tests be located?
- Can I force the mySQL build somehow?
- I think the include path has to point to mysql.h - correct?
Any hint highly welcome.
Bookmarks