Planned maintenance has been done but it did not solve the problem. So work will continue on this and a new time for trying updates will be announced asap.

Trouble Building MySQL Driver

  • This post is deleted!

  • Hello,

    I encountered similar issue before. I solved it by downloading mysql dll for C from mysql website, I then proceed to move my libmysql.dll into the same folder as my executable.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Please search the form a bit, that question has been asked many times already. You need to install Qt's sources and build the MySQL plugin. The sources can be installed through e.g. the Online Installer

  • Hi,

    Sorry for delayed response. I made some progress, I think. I finally found the Qt source code and now I'm trying to build the plugin from source. I'm now getting an error when I call make. Here's the console output:

    rofln@ubuntu:~/Desktop/qt-everywhere-opensource-src-5.5.1/qtbase/src/plugins/sqldrivers/mysql$ /opt/Qt/5.5/gcc_64/bin/qmake "INCLUDEPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib/mysql -ldl -lmysqlclient_r"
    rofln@ubuntu:~/Desktop/qt-everywhere-opensource-src-5.5.1/qtbase/src/plugins/sqldrivers/mysql$ make
       ****compiler stuff*****
        /usr/lib64/mysql/libmysqlclient_r.a(client_plugin.c.o): In function `do_add_plugin':
     /export/home/pb2/build/sb_0-14542007-1424899317.1/rpm/BUILD/mysql-connector-c-6.1.6-src/mysql-connector-c-6.1.6-    src/sql-common/client_plugin.c:245: undefined reference to `dlclose'
    /usr/lib64/mysql/libmysqlclient_r.a(client_plugin.c.o): In function `mysql_client_plugin_deinit':
    /export/home/pb2/build/sb_0-14542007-1424899317.1/rpm/BUILD/mysql-connector-c-6.1.6-src/mysql-connector-c-6.1.6-src/sql-common/client_plugin.c:381: undefined reference to `dlclose'
    /usr/lib64/mysql/libmysqlclient_r.a(client_plugin.c.o): In function `mysql_load_plugin_v':
    /export/home/pb2/build/sb_0-14542007-1424899317.1/rpm/BUILD/mysql-connector-c-6.1.6-src/mysql-connector-c-6.1.6-src/sql-common/client_plugin.c:469: undefined reference to `dlopen'
    /export/home/pb2/build/sb_0-14542007-1424899317.1/rpm/BUILD/mysql-connector-c-6.1.6-src/mysql-connector-c-6.1.6-src/sql-common/client_plugin.c:497: undefined reference to `dlsym'
    /export/home/pb2/build/sb_0-14542007-1424899317.1/rpm/BUILD/mysql-connector-c-6.1.6-src/mysql-connector-c-6.1.6-src/sql-common/client_plugin.c:488: undefined reference to `dlerror'
    /export/home/pb2/build/sb_0-14542007-1424899317.1/rpm/BUILD/mysql-connector-c-6.1.6-src/mysql-connector-c-6.1.6-src/sql-common/client_plugin.c:500: undefined reference to `dlclose'

    I looked online to find that I had to add the -ldl linker flag. I've tried it before and after the -lmysqlclient_r flag but get the same output. Any ideas?

  • Finally fixed it. I had the wrong file path to my shared library files.

Log in to reply