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. QtCreator cannot load QMYSQL driver

QtCreator cannot load QMYSQL driver

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.0k Views 1 Watching
  • 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.
  • B Offline
    B Offline
    baijiaheizhiganmao
    wrote on last edited by
    #1

    Hi everyone!
    I need to visit mysql ,and I just write a small test program to test it . I can build my program but when I clicked run button it remind me :
    QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7
    Unable to open database

    And some more infomation may be help:

    fjy@ubuntu:~$ locate libqsqlmysql.so
    /home/fjy/Qt5.4.0/5.4/gcc/plugins/sqldrivers/libqsqlmysql.so
    /home/fjy/Qt5.4.0/Tools/QtCreator/bin/plugins/sqldrivers/libqsqlmysql.so
    /usr/lib/i386-linux-gnu/qt4/plugins/sqldrivers/libqsqlmysql.so
    I have copied this *.so file to the libpath of qt.ANd my system is ubuntu 32bit.

    The Qt version is Qt Creator 3.3.0(opensource) based on Qt 5.4.0(GCC 4.6.1 32bit)

    I have use google to search this question ,but I still cannot solve it.

    Holp someone could give some advice!
    Thank you!

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      Your system may be missing MySQL libraries.
      Check whether libqsqlmysql.so's dependencies are resolved
      @
      ldd /home/fjy/Qt5.4.0/5.4/gcc/plugins/sqldrivers/libqsqlmysql.so
      @

      157

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DBoosalis
        wrote on last edited by
        #3

        How about showing the code on how you open the database

        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