Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QMySql not loaded
Forum Updated to NodeBB v4.3 + New Features

QMySql not loaded

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
mysqldatabaselibqmysql
10 Posts 3 Posters 3.9k 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.
  • smb564S Offline
    smb564S Offline
    smb564
    wrote on last edited by A Former User
    #1

    First of all I must say I had spent almost two days searching a solution for this problem. I looked at a lot of forum posts regarding this and I couldn't find a solution.

    When I'am using QMySql driver to access mysql database in my localhost, it says,
    QMySql driver not loaded.
    *But it is in the list of available drivers.

    So far I have figured our there is a dependency problem in the libqsqlmysql.so (Located in /Qt/5.6/gcc_64/plugins/sqldriver/)

    Here's the output when I ran the "ldd libqsqlmysql.so" command.

    linux-vdso.so.1 =>  (0x00007ffeea366000)
    libmysqlclient_r.so.16 => not found
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9d02f94000)
    libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f9d02d5b000)
    libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f9d02b41000)
    libssl.so.10 => /lib/x86_64-linux-gnu/libssl.so.10 (0x00007f9d028e2000)
    libcrypto.so.10 => /lib/x86_64-linux-gnu/libcrypto.so.10 (0x00007f9d02506000)
    libQt5Sql.so.5 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libQt5Sql.so.5 (0x00007f9d022c2000)
    libQt5Core.so.5 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libQt5Core.so.5 (0x00007f9d01bb0000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9d01992000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9d0168e000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9d01388000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9d01172000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9d00dad000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9d00ba9000)
    libicui18n.so.56 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libicui18n.so.56 (0x00007f9d0070f000)
    libicuuc.so.56 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libicuuc.so.56 (0x00007f9d00357000)
    libicudata.so.56 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libicudata.so.56 (0x00007f9cfe974000)
    libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f9cfe772000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9cfe56a000)
    libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f9cfe262000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f9d033bf000)
    libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f9cfe024000)
    

    So it says libmysqlclient_r.so.16 not found.

    How to fix this error?
    Regards in advance.
    Please help me.

    p3c0P larryn46L 2 Replies Last reply
    0
    • smb564S smb564

      First of all I must say I had spent almost two days searching a solution for this problem. I looked at a lot of forum posts regarding this and I couldn't find a solution.

      When I'am using QMySql driver to access mysql database in my localhost, it says,
      QMySql driver not loaded.
      *But it is in the list of available drivers.

      So far I have figured our there is a dependency problem in the libqsqlmysql.so (Located in /Qt/5.6/gcc_64/plugins/sqldriver/)

      Here's the output when I ran the "ldd libqsqlmysql.so" command.

      linux-vdso.so.1 =>  (0x00007ffeea366000)
      libmysqlclient_r.so.16 => not found
      libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9d02f94000)
      libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f9d02d5b000)
      libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f9d02b41000)
      libssl.so.10 => /lib/x86_64-linux-gnu/libssl.so.10 (0x00007f9d028e2000)
      libcrypto.so.10 => /lib/x86_64-linux-gnu/libcrypto.so.10 (0x00007f9d02506000)
      libQt5Sql.so.5 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libQt5Sql.so.5 (0x00007f9d022c2000)
      libQt5Core.so.5 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libQt5Core.so.5 (0x00007f9d01bb0000)
      libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9d01992000)
      libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9d0168e000)
      libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9d01388000)
      libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9d01172000)
      libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9d00dad000)
      libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9d00ba9000)
      libicui18n.so.56 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libicui18n.so.56 (0x00007f9d0070f000)
      libicuuc.so.56 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libicuuc.so.56 (0x00007f9d00357000)
      libicudata.so.56 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libicudata.so.56 (0x00007f9cfe974000)
      libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f9cfe772000)
      librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9cfe56a000)
      libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f9cfe262000)
      /lib64/ld-linux-x86-64.so.2 (0x00007f9d033bf000)
      libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f9cfe024000)
      

      So it says libmysqlclient_r.so.16 not found.

      How to fix this error?
      Regards in advance.
      Please help me.

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi @smb564 and Welcome,
      Your system is missing mysql client libraries. Use your distro's tool to install them.
      P. S. This question is quite common on this forum :)

      157

      smb564S 1 Reply Last reply
      1
      • p3c0P p3c0

        Hi @smb564 and Welcome,
        Your system is missing mysql client libraries. Use your distro's tool to install them.
        P. S. This question is quite common on this forum :)

        smb564S Offline
        smb564S Offline
        smb564
        wrote on last edited by
        #3

        @p3c0 Thank you for the reply.
        I installed them.
        I am using ubuntu. I have installed mysql-client & libmysqlclient-dev.
        Are those the files required?

        p3c0P 1 Reply Last reply
        0
        • smb564S smb564

          @p3c0 Thank you for the reply.
          I installed them.
          I am using ubuntu. I have installed mysql-client & libmysqlclient-dev.
          Are those the files required?

          p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by p3c0
          #4

          @smb564 Well just the mysql client libraries unless you are recompiling the driver.
          Your system probably has a different version of that library.
          For eg. My system has libmysqlclient_r.so.18
          Create a symbolic link of the missing library to the library installed on your system.

          157

          1 Reply Last reply
          1
          • smb564S Offline
            smb564S Offline
            smb564
            wrote on last edited by
            #5

            I have created a symbolic link and now the output of ldd command changed as follows.
            ./libqsqlmysql.so: /usr/lib/x86_64-linux-gnu/libmysqlclient_r.so.16: version `libmysqlclient_16' not found (required by ./libqsqlmysql.so)
            linux-vdso.so.1 => (0x00007ffd91832000)
            libmysqlclient_r.so.16 => /usr/lib/x86_64-linux-gnu/libmysqlclient_r.so.16 (0x00007f9479cce000)
            libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9479ab5000)
            libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f947987c000)
            libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f9479662000)
            libssl.so.10 => /lib/x86_64-linux-gnu/libssl.so.10 (0x00007f9479403000)
            libcrypto.so.10 => /lib/x86_64-linux-gnu/libcrypto.so.10 (0x00007f9479027000)
            libQt5Sql.so.5 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libQt5Sql.so.5 (0x00007f9478de3000)
            libQt5Core.so.5 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libQt5Core.so.5 (0x00007f94786d1000)
            libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f94784b3000)
            libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f94781af000)
            libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9477ea9000)
            libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9477c93000)
            libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f94778ce000)
            libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f94776ca000)
            libicui18n.so.56 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libicui18n.so.56 (0x00007f9477230000)
            libicuuc.so.56 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libicuuc.so.56 (0x00007f9476e78000)
            libicudata.so.56 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libicudata.so.56 (0x00007f9475495000)
            libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f9475293000)
            librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f947508b000)
            libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f9474d83000)
            /lib64/ld-linux-x86-64.so.2 (0x00007f947a418000)
            libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f9474b45000)

            p3c0P 1 Reply Last reply
            0
            • smb564S smb564

              I have created a symbolic link and now the output of ldd command changed as follows.
              ./libqsqlmysql.so: /usr/lib/x86_64-linux-gnu/libmysqlclient_r.so.16: version `libmysqlclient_16' not found (required by ./libqsqlmysql.so)
              linux-vdso.so.1 => (0x00007ffd91832000)
              libmysqlclient_r.so.16 => /usr/lib/x86_64-linux-gnu/libmysqlclient_r.so.16 (0x00007f9479cce000)
              libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9479ab5000)
              libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f947987c000)
              libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f9479662000)
              libssl.so.10 => /lib/x86_64-linux-gnu/libssl.so.10 (0x00007f9479403000)
              libcrypto.so.10 => /lib/x86_64-linux-gnu/libcrypto.so.10 (0x00007f9479027000)
              libQt5Sql.so.5 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libQt5Sql.so.5 (0x00007f9478de3000)
              libQt5Core.so.5 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libQt5Core.so.5 (0x00007f94786d1000)
              libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f94784b3000)
              libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f94781af000)
              libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9477ea9000)
              libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9477c93000)
              libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f94778ce000)
              libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f94776ca000)
              libicui18n.so.56 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libicui18n.so.56 (0x00007f9477230000)
              libicuuc.so.56 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libicuuc.so.56 (0x00007f9476e78000)
              libicudata.so.56 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libicudata.so.56 (0x00007f9475495000)
              libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f9475293000)
              librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f947508b000)
              libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f9474d83000)
              /lib64/ld-linux-x86-64.so.2 (0x00007f947a418000)
              libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f9474b45000)

              p3c0P Offline
              p3c0P Offline
              p3c0
              Moderators
              wrote on last edited by
              #6

              @smb564 Unfortunately linking is not sufficient it seems. Either you will need the exact version or you can compile the driver against the existing libraries. It is described here.

              157

              smb564S 1 Reply Last reply
              1
              • p3c0P p3c0

                @smb564 Unfortunately linking is not sufficient it seems. Either you will need the exact version or you can compile the driver against the existing libraries. It is described here.

                smb564S Offline
                smb564S Offline
                smb564
                wrote on last edited by
                #7

                @p3c0 I don't know whether I am missing the obvious here. But I can't seem to find a folder like $QTDIR/qtbase/src/plugins/sqldrivers/mysql neither mysql.pro

                p3c0P 1 Reply Last reply
                0
                • smb564S smb564

                  @p3c0 I don't know whether I am missing the obvious here. But I can't seem to find a folder like $QTDIR/qtbase/src/plugins/sqldrivers/mysql neither mysql.pro

                  p3c0P Offline
                  p3c0P Offline
                  p3c0
                  Moderators
                  wrote on last edited by p3c0
                  #8

                  @smb564 You will need to install the source components too. The installer provides an option during installation.

                  157

                  smb564S 1 Reply Last reply
                  1
                  • p3c0P p3c0

                    @smb564 You will need to install the source components too. The installer provides an option during installation.

                    smb564S Offline
                    smb564S Offline
                    smb564
                    wrote on last edited by
                    #9

                    @p3c0 Thank you very much for your help! Now it works. :)

                    I installed with source and followed the instructions in the Qt docs and manually built it.

                    1 Reply Last reply
                    0
                    • smb564S smb564

                      First of all I must say I had spent almost two days searching a solution for this problem. I looked at a lot of forum posts regarding this and I couldn't find a solution.

                      When I'am using QMySql driver to access mysql database in my localhost, it says,
                      QMySql driver not loaded.
                      *But it is in the list of available drivers.

                      So far I have figured our there is a dependency problem in the libqsqlmysql.so (Located in /Qt/5.6/gcc_64/plugins/sqldriver/)

                      Here's the output when I ran the "ldd libqsqlmysql.so" command.

                      linux-vdso.so.1 =>  (0x00007ffeea366000)
                      libmysqlclient_r.so.16 => not found
                      libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9d02f94000)
                      libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f9d02d5b000)
                      libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f9d02b41000)
                      libssl.so.10 => /lib/x86_64-linux-gnu/libssl.so.10 (0x00007f9d028e2000)
                      libcrypto.so.10 => /lib/x86_64-linux-gnu/libcrypto.so.10 (0x00007f9d02506000)
                      libQt5Sql.so.5 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libQt5Sql.so.5 (0x00007f9d022c2000)
                      libQt5Core.so.5 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libQt5Core.so.5 (0x00007f9d01bb0000)
                      libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9d01992000)
                      libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9d0168e000)
                      libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9d01388000)
                      libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9d01172000)
                      libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9d00dad000)
                      libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9d00ba9000)
                      libicui18n.so.56 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libicui18n.so.56 (0x00007f9d0070f000)
                      libicuuc.so.56 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libicuuc.so.56 (0x00007f9d00357000)
                      libicudata.so.56 => /opt/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libicudata.so.56 (0x00007f9cfe974000)
                      libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f9cfe772000)
                      librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9cfe56a000)
                      libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f9cfe262000)
                      /lib64/ld-linux-x86-64.so.2 (0x00007f9d033bf000)
                      libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f9cfe024000)
                      

                      So it says libmysqlclient_r.so.16 not found.

                      How to fix this error?
                      Regards in advance.
                      Please help me.

                      larryn46L Offline
                      larryn46L Offline
                      larryn46
                      wrote on last edited by
                      #10

                      @smb564 I had the same problem with QMYSQL not loaded. I ran
                      $sudo apt-get installlibqt4-sql-mysql
                      and it worked

                      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