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. MySql Driver not loaded , Note: i tried all the existed forums problems and didn't work
Forum Updated to NodeBB v4.3 + New Features

MySql Driver not loaded , Note: i tried all the existed forums problems and didn't work

Scheduled Pinned Locked Moved Solved General and Desktop
25 Posts 4 Posters 3.5k 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.
  • Christian EhrlicherC Offline
    Christian EhrlicherC Offline
    Christian Ehrlicher
    Lifetime Qt Champion
    wrote on last edited by
    #21

    @jsulm said in MySql Driver not loaded , Note: i tried all the existed forums problems and didn't work:

    I'm asking because you used qmake without absolute path.

    And because the plugin name is wrong - the '4' looks suspicious.

    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
    Visit the Qt Academy at https://academy.qt.io/catalog

    1 Reply Last reply
    1
    • jsulmJ jsulm

      @MostafaEzzat It still looks like you DO not follow the documentation (https://doc.qt.io/qt-5/sql-driver.html#building-the-drivers): after building you need to do "make install", that will copy the DLLs to your Qt installation.
      Also, are you sure you used the correct qmake to build the plug-ins? I'm asking because you used qmake without absolute path.

      M Offline
      M Offline
      MostafaEzzat
      wrote on last edited by
      #22

      @jsulm

      i did use

      mingw32-make sub-mysql
      
      then
      
      mingw32-make install
      

      but i'm not sure i use the right path because i was running this software on linux before
      but this my .pro file
      should i change the path from .pro file or options

      #-------------------------------------------------
      #
      # Project created by QtCreator 2018-12-24T22:54:39
      #
      #-------------------------------------------------
      #
      
      QT  += core gui sql
       greaterThan(QT_MAJOR_VERSION, 4): QT += widgets designer
      
      TARGET = Hospital-ClinicSoftware
      TEMPLATE += app lib libs
      
      # The following define makes your compiler emit warnings if you use
      # any feature of Qt which has been marked as deprecated (the exact warnings
      # depend on your compiler). Please consult the documentation of the
      # deprecated API in order to know how to port your code away from it.
      DEFINES += QT_DEPRECATED_WARNINGS
      
      # You can also make your code fail to compile if you use deprecated APIs.
      # In order to do so, uncomment the following line.
      # You can also select to disable deprecated APIs only up to a certain version of Qt.
      #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
      
      
      
      CONFIG += c++11 designer plugins plugin
      
      SOURCES += \
              main.cpp \
              mainwindow.cpp \
          mainprocess.cpp \
          mysqldatabase.cpp \
          showingdata.cpp \
          delgate.cpp \
          profile3.cpp \
          profile.cpp \
         multipagewidget.cpp \
          multipagewidgetplugin.cpp \
          multipagewidgetcontainerextension.cpp \
           multipagewidgetextensionfactory.cpp \
      
      
          mysqldatabase.cpp
      
      HEADERS += \
               mainwindow.h \
          mainprocess.h \
          showingdata.h \
          delgate.h \
          profile3.h \
          profile.h \
          multipagewidget.h \
                    multipagewidgetplugin.h \
                    multipagewidgetcontainerextension.h \
                    multipagewidgetextensionfactory.h \
          mysqldatabase.h
      
      
      
      FORMS += \
           mainwindow.ui \
          mainprocess.ui \
          showingdata.ui \
          profile3.ui \
          profile.ui
      
      # Default rules for deployment.
      qnx: target.path = /tmp/$${TARGET}/bin
      else: unix:!android: target.path += /opt/$${TARGET}/bin $$[QT_INSTALL_PLUGINS]/designer
      !isEmpty(target.path): INSTALLS += target
      
      
      jsulmJ 1 Reply Last reply
      0
      • M MostafaEzzat

        @jsulm

        i did use

        mingw32-make sub-mysql
        
        then
        
        mingw32-make install
        

        but i'm not sure i use the right path because i was running this software on linux before
        but this my .pro file
        should i change the path from .pro file or options

        #-------------------------------------------------
        #
        # Project created by QtCreator 2018-12-24T22:54:39
        #
        #-------------------------------------------------
        #
        
        QT  += core gui sql
         greaterThan(QT_MAJOR_VERSION, 4): QT += widgets designer
        
        TARGET = Hospital-ClinicSoftware
        TEMPLATE += app lib libs
        
        # The following define makes your compiler emit warnings if you use
        # any feature of Qt which has been marked as deprecated (the exact warnings
        # depend on your compiler). Please consult the documentation of the
        # deprecated API in order to know how to port your code away from it.
        DEFINES += QT_DEPRECATED_WARNINGS
        
        # You can also make your code fail to compile if you use deprecated APIs.
        # In order to do so, uncomment the following line.
        # You can also select to disable deprecated APIs only up to a certain version of Qt.
        #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
        
        
        
        CONFIG += c++11 designer plugins plugin
        
        SOURCES += \
                main.cpp \
                mainwindow.cpp \
            mainprocess.cpp \
            mysqldatabase.cpp \
            showingdata.cpp \
            delgate.cpp \
            profile3.cpp \
            profile.cpp \
           multipagewidget.cpp \
            multipagewidgetplugin.cpp \
            multipagewidgetcontainerextension.cpp \
             multipagewidgetextensionfactory.cpp \
        
        
            mysqldatabase.cpp
        
        HEADERS += \
                 mainwindow.h \
            mainprocess.h \
            showingdata.h \
            delgate.h \
            profile3.h \
            profile.h \
            multipagewidget.h \
                      multipagewidgetplugin.h \
                      multipagewidgetcontainerextension.h \
                      multipagewidgetextensionfactory.h \
            mysqldatabase.h
        
        
        
        FORMS += \
             mainwindow.ui \
            mainprocess.ui \
            showingdata.ui \
            profile3.ui \
            profile.ui
        
        # Default rules for deployment.
        qnx: target.path = /tmp/$${TARGET}/bin
        else: unix:!android: target.path += /opt/$${TARGET}/bin $$[QT_INSTALL_PLUGINS]/designer
        !isEmpty(target.path): INSTALLS += target
        
        
        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #23

        @MostafaEzzat You should call qmake using whole path to make sure you use the one from the Qt version you're building for.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        M 1 Reply Last reply
        0
        • jsulmJ jsulm

          @MostafaEzzat You should call qmake using whole path to make sure you use the one from the Qt version you're building for.

          M Offline
          M Offline
          MostafaEzzat
          wrote on last edited by
          #24

          @jsulm

          such a weird thing , i didn't know that i should copy libmysql.dll to D:\Qt\5.15.1\mingw81_32\plugins\sqldrivers

          i only copied to mingw81_32/bin

          now it's working

          Got keys from plugin meta data ("QPSQL7", "QPSQL")
          QFactoryLoader::QFactoryLoader() checking directory path "C:/Users/Mostafa/Downloads/HospitalSoftware Last Version/build-Hospital-ClinicSoftware-Desktop_Qt_5_15_1_MinGW_32_bit-Debug/debug/sqldrivers" ...
          ("QSQLITE", "QMARIADB", "QMYSQL", "QMYSQL3", "QODBC", "QODBC3", "QPSQL", "QPSQL7")
          loaded library "D:/Qt/5.15.1/mingw81_32/plugins/sqldrivers/qsqlmysql.dll"
          Donnne
          Connected
          

          Thank you guys i do love this community

          jsulmJ 1 Reply Last reply
          1
          • M MostafaEzzat

            @jsulm

            such a weird thing , i didn't know that i should copy libmysql.dll to D:\Qt\5.15.1\mingw81_32\plugins\sqldrivers

            i only copied to mingw81_32/bin

            now it's working

            Got keys from plugin meta data ("QPSQL7", "QPSQL")
            QFactoryLoader::QFactoryLoader() checking directory path "C:/Users/Mostafa/Downloads/HospitalSoftware Last Version/build-Hospital-ClinicSoftware-Desktop_Qt_5_15_1_MinGW_32_bit-Debug/debug/sqldrivers" ...
            ("QSQLITE", "QMARIADB", "QMYSQL", "QMYSQL3", "QODBC", "QODBC3", "QPSQL", "QPSQL7")
            loaded library "D:/Qt/5.15.1/mingw81_32/plugins/sqldrivers/qsqlmysql.dll"
            Donnne
            Connected
            

            Thank you guys i do love this community

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #25

            @MostafaEzzat Yes, plug-ins are somewhat special: they are expected to be in a specific location and are loaded at runtime.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1

            • Login

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