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. Qt MYSQL plugin not loaded
Forum Updated to NodeBB v4.3 + New Features

Qt MYSQL plugin not loaded

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 299 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.
  • G Offline
    G Offline
    GregB
    wrote on last edited by
    #1

    I'm building a CentOS 8 Qt 5.12.8 application that uses MariaDB. I've built the MySQL plugin using the methods described here: https://doc.qt.io/qt-5.12/sql-driver.html. I ran make and make install, and it works to create a libqsqlmysql.so library file. My application builds without error, and successfully connects to the database on my build machine.

    The problem occurs when running my binary on a server that does not have Qt installed, ie a fresh install of CentOS 8. The MYSQL plugin is not loaded, with an error message "Driver not loaded". I've tried putting the libqsqlmysql.so file in the following locations (where binpath is the location of my binary program), and none work:

    /usr/lib

    <binpath>/plugins

    <binpath>/plugins/sqldrivers

    ~/Qt/5.12.8/gcc_64/plugins/sqldrivers

    I've also run ldd on my binary, and it does not list libqsqlmysql.so as one of the dependencies. Did I not build my application correctly? Where should I put the libqsqlmysql.so on the target machine?

    JonBJ 1 Reply Last reply
    0
    • G GregB

      I'm building a CentOS 8 Qt 5.12.8 application that uses MariaDB. I've built the MySQL plugin using the methods described here: https://doc.qt.io/qt-5.12/sql-driver.html. I ran make and make install, and it works to create a libqsqlmysql.so library file. My application builds without error, and successfully connects to the database on my build machine.

      The problem occurs when running my binary on a server that does not have Qt installed, ie a fresh install of CentOS 8. The MYSQL plugin is not loaded, with an error message "Driver not loaded". I've tried putting the libqsqlmysql.so file in the following locations (where binpath is the location of my binary program), and none work:

      /usr/lib

      <binpath>/plugins

      <binpath>/plugins/sqldrivers

      ~/Qt/5.12.8/gcc_64/plugins/sqldrivers

      I've also run ldd on my binary, and it does not list libqsqlmysql.so as one of the dependencies. Did I not build my application correctly? Where should I put the libqsqlmysql.so on the target machine?

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

      @GregB
      Always start by going export QT_DEBUG_PLUGINS=1 in a shell and then running your app. Look through the debug output as your first port of call for whatever is happening.

      1 Reply Last reply
      2
      • G Offline
        G Offline
        GregB
        wrote on last edited by
        #3

        That worked!!! Thank you!

        1 Reply Last reply
        0

        • Login

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