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 5.15 mysql plugin on Debian 10
Forum Update on Monday, May 27th 2025

Qt 5.15 mysql plugin on Debian 10

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 4 Posters 696 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.
  • L Offline
    L Offline
    luca
    wrote on last edited by
    #1

    Hi all,
    I just installed Qt 5.15 on my debian 10 machine and I need to build mysql plugin.
    It seems I can't build plugin and I don't know why.
    I'm following https://doc.qt.io/qt-5/sql-driver.html but I'm continuing to receive:

    Project ERROR: Library 'mysql' is not defined.

    Where do I wrong?
    I compiled in the past mysql plugin on previous debian version.

    Thanks

    Ketan__Patel__0011K 1 Reply Last reply
    0
    • L luca

      Hi all,
      I just installed Qt 5.15 on my debian 10 machine and I need to build mysql plugin.
      It seems I can't build plugin and I don't know why.
      I'm following https://doc.qt.io/qt-5/sql-driver.html but I'm continuing to receive:

      Project ERROR: Library 'mysql' is not defined.

      Where do I wrong?
      I compiled in the past mysql plugin on previous debian version.

      Thanks

      Ketan__Patel__0011K Offline
      Ketan__Patel__0011K Offline
      Ketan__Patel__0011
      wrote on last edited by
      #2

      @luca

      Hi

      i have solution for it
      open the terminal and run following command

      sudo apt-get install libqt5sql5-mysql

      L 1 Reply Last reply
      2
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        What sources are you using to build the plugin ?
        If not a new one, did you clean it up before starting the new build ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        L 1 Reply Last reply
        0
        • Ketan__Patel__0011K Ketan__Patel__0011

          @luca

          Hi

          i have solution for it
          open the terminal and run following command

          sudo apt-get install libqt5sql5-mysql

          L Offline
          L Offline
          luca
          wrote on last edited by
          #4

          @Ketan__Patel__0011 Thanks but I need to compile it, not to use a built version.

          1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            What sources are you using to build the plugin ?
            If not a new one, did you clean it up before starting the new build ?

            L Offline
            L Offline
            luca
            wrote on last edited by luca
            #5

            @SGaist
            I'm using Qt 5.15.0 source.
            Is there some compatibility version to be used for mariadb/mysql dev libraries?

            1 Reply Last reply
            0
            • L Offline
              L Offline
              luca
              wrote on last edited by
              #6

              OK, I just tried from tar.gz source and now it seems I can build MySql plugin:

              Qt Sql Drivers:
                DB2 (IBM) .............................. no
                InterBase .............................. no
                MySql .................................. yes
                OCI (Oracle) ........................... no
                ODBC ................................... no
                PostgreSQL ............................. no
                SQLite2 ................................ no
                SQLite ................................. yes
                  Using system provided SQLite ......... no
                TDS (Sybase) ........................... no
              
              

              I had problem using Src dir inside Qt installed using online installer....

              What should be the reason?

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Without checking the test logs, no way to tell.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  luca
                  wrote on last edited by
                  #8

                  I tried again from Qt installed with online installer:

                  ./configure .... -v
                  ...
                  ...
                  ...
                  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.
                  

                  while from Qt from tar.gz source:

                  ./configure .... -v
                  ...
                  ...
                  ...
                  Trying source 0 (type mysqlConfig) of library mysql ...
                  + /usr/bin/mysql_config --version
                  > 10.3.23
                  + /usr/bin/mysql_config --libs_r
                  > -L/usr/lib/x86_64-linux-gnu/ -lmariadb
                  + /usr/bin/mysql_config --include
                  > -I/usr/include/mariadb -I/usr/include/mariadb/mysql
                  + cd /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql && /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static warn_off console single_arch" 'QMAKE_USE += mysql' 'QMAKE_LIBS_MYSQL = -L/usr/lib/x86_64-linux-gnu/' 'QMAKE_INCDIR_MYSQL = /usr/include/mariadb /usr/include/mariadb/mysql' /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql
                  + cd /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql && MAKEFLAGS= /usr/bin/make
                  > g++ -c -pipe -O2 -w -fPIC  -I. -isystem /usr/include/mariadb -isystem /usr/include/mariadb/mysql -I/mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/qtbase/mkspecs/linux-g++ -o main.o main.cpp
                  > g++ -Wl,-O1 -o mysql main.o   -L/usr/lib/x86_64-linux-gnu/   
                  > /usr/bin/ld: main.o: in function `main':
                  > main.cpp:(.text.startup+0x5): undefined reference to `mysql_get_client_version'
                  > collect2: error: ld returned 1 exit status
                  > make: *** [Makefile:67: mysql] Error 1
                   => source failed verification.
                  Trying source 1 (type mysqlConfig) of library mysql ...
                  + /usr/bin/mysql_config --version
                  > 10.3.23
                  + /usr/bin/mysql_config --libs
                  > -L/usr/lib/x86_64-linux-gnu/ -lmariadb
                  + /usr/bin/mysql_config --include
                  > -I/usr/include/mariadb -I/usr/include/mariadb/mysql
                  + cd /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql && /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static warn_off console single_arch" 'QMAKE_USE += mysql' 'QMAKE_LIBS_MYSQL = -L/usr/lib/x86_64-linux-gnu/' 'QMAKE_INCDIR_MYSQL = /usr/include/mariadb /usr/include/mariadb/mysql' /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql
                  + cd /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make
                  > rm -f main.o
                  > rm -f *~ core *.core
                  > g++ -c -pipe -O2 -w -fPIC  -I. -isystem /usr/include/mariadb -isystem /usr/include/mariadb/mysql -I/mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/qtbase/mkspecs/linux-g++ -o main.o main.cpp
                  > g++ -Wl,-O1 -o mysql main.o   -L/usr/lib/x86_64-linux-gnu/   
                  > /usr/bin/ld: main.o: in function `main':
                  > main.cpp:(.text.startup+0x5): undefined reference to `mysql_get_client_version'
                  > collect2: error: ld returned 1 exit status
                  > make: *** [Makefile:67: mysql] Error 1
                   => source failed verification.
                  Trying source 2 (type mysqlConfig) of library mysql ...
                  + /usr/bin/mysql_config --version
                  > 10.3.23
                  + /usr/bin/mysql_config --libs_r
                  > -L/usr/lib/x86_64-linux-gnu/ -lmariadb
                  + /usr/bin/mysql_config --include
                  > -I/usr/include/mariadb -I/usr/include/mariadb/mysql
                  + cd /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql && /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static warn_off console single_arch" 'QMAKE_USE += mysql' 'QMAKE_LIBS_MYSQL = -L/usr/lib/x86_64-linux-gnu/ -lmariadb' 'QMAKE_INCDIR_MYSQL = /usr/include/mariadb /usr/include/mariadb/mysql' /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql
                  + cd /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make
                  > rm -f main.o
                  > rm -f *~ core *.core
                  > g++ -c -pipe -O2 -w -fPIC  -I. -isystem /usr/include/mariadb -isystem /usr/include/mariadb/mysql -I/mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/qtbase/mkspecs/linux-g++ -o main.o main.cpp
                  > g++ -Wl,-O1 -o mysql main.o   -L/usr/lib/x86_64-linux-gnu/ -lmariadb   
                   => source accepted.
                  
                  

                  It seems it's looking for different path of mysq_config .

                  eyllanescE 1 Reply Last reply
                  0
                  • L luca

                    I tried again from Qt installed with online installer:

                    ./configure .... -v
                    ...
                    ...
                    ...
                    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.
                    

                    while from Qt from tar.gz source:

                    ./configure .... -v
                    ...
                    ...
                    ...
                    Trying source 0 (type mysqlConfig) of library mysql ...
                    + /usr/bin/mysql_config --version
                    > 10.3.23
                    + /usr/bin/mysql_config --libs_r
                    > -L/usr/lib/x86_64-linux-gnu/ -lmariadb
                    + /usr/bin/mysql_config --include
                    > -I/usr/include/mariadb -I/usr/include/mariadb/mysql
                    + cd /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql && /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static warn_off console single_arch" 'QMAKE_USE += mysql' 'QMAKE_LIBS_MYSQL = -L/usr/lib/x86_64-linux-gnu/' 'QMAKE_INCDIR_MYSQL = /usr/include/mariadb /usr/include/mariadb/mysql' /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql
                    + cd /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql && MAKEFLAGS= /usr/bin/make
                    > g++ -c -pipe -O2 -w -fPIC  -I. -isystem /usr/include/mariadb -isystem /usr/include/mariadb/mysql -I/mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/qtbase/mkspecs/linux-g++ -o main.o main.cpp
                    > g++ -Wl,-O1 -o mysql main.o   -L/usr/lib/x86_64-linux-gnu/   
                    > /usr/bin/ld: main.o: in function `main':
                    > main.cpp:(.text.startup+0x5): undefined reference to `mysql_get_client_version'
                    > collect2: error: ld returned 1 exit status
                    > make: *** [Makefile:67: mysql] Error 1
                     => source failed verification.
                    Trying source 1 (type mysqlConfig) of library mysql ...
                    + /usr/bin/mysql_config --version
                    > 10.3.23
                    + /usr/bin/mysql_config --libs
                    > -L/usr/lib/x86_64-linux-gnu/ -lmariadb
                    + /usr/bin/mysql_config --include
                    > -I/usr/include/mariadb -I/usr/include/mariadb/mysql
                    + cd /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql && /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static warn_off console single_arch" 'QMAKE_USE += mysql' 'QMAKE_LIBS_MYSQL = -L/usr/lib/x86_64-linux-gnu/' 'QMAKE_INCDIR_MYSQL = /usr/include/mariadb /usr/include/mariadb/mysql' /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql
                    + cd /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make
                    > rm -f main.o
                    > rm -f *~ core *.core
                    > g++ -c -pipe -O2 -w -fPIC  -I. -isystem /usr/include/mariadb -isystem /usr/include/mariadb/mysql -I/mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/qtbase/mkspecs/linux-g++ -o main.o main.cpp
                    > g++ -Wl,-O1 -o mysql main.o   -L/usr/lib/x86_64-linux-gnu/   
                    > /usr/bin/ld: main.o: in function `main':
                    > main.cpp:(.text.startup+0x5): undefined reference to `mysql_get_client_version'
                    > collect2: error: ld returned 1 exit status
                    > make: *** [Makefile:67: mysql] Error 1
                     => source failed verification.
                    Trying source 2 (type mysqlConfig) of library mysql ...
                    + /usr/bin/mysql_config --version
                    > 10.3.23
                    + /usr/bin/mysql_config --libs_r
                    > -L/usr/lib/x86_64-linux-gnu/ -lmariadb
                    + /usr/bin/mysql_config --include
                    > -I/usr/include/mariadb -I/usr/include/mariadb/mysql
                    + cd /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql && /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static warn_off console single_arch" 'QMAKE_USE += mysql' 'QMAKE_LIBS_MYSQL = -L/usr/lib/x86_64-linux-gnu/ -lmariadb' 'QMAKE_INCDIR_MYSQL = /usr/include/mariadb /usr/include/mariadb/mysql' /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql
                    + cd /mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/config.tests/mysql && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make
                    > rm -f main.o
                    > rm -f *~ core *.core
                    > g++ -c -pipe -O2 -w -fPIC  -I. -isystem /usr/include/mariadb -isystem /usr/include/mariadb/mysql -I/mnt/temporanea/Downloads/qt-everywhere-src-5.15.0/qtbase/mkspecs/linux-g++ -o main.o main.cpp
                    > g++ -Wl,-O1 -o mysql main.o   -L/usr/lib/x86_64-linux-gnu/ -lmariadb   
                     => source accepted.
                    
                    

                    It seems it's looking for different path of mysq_config .

                    eyllanescE Offline
                    eyllanescE Offline
                    eyllanesc
                    wrote on last edited by
                    #9

                    @luca install libmysqlclient-dev package

                    If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

                    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