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. Win 10 drivers mysql not load
QtWS25 Last Chance

Win 10 drivers mysql not load

Scheduled Pinned Locked Moved Unsolved General and Desktop
15 Posts 3 Posters 2.3k 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #4

    I don't either because you didn't post the actual error.

    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
    • TheCipo76T Offline
      TheCipo76T Offline
      TheCipo76
      wrote on last edited by TheCipo76
      #5

      After download MySQL community 5.5.61 Win32
      i've tried following:

      1. Qt Documentation (http://doc.qt.io/qt-5/sql-driver.html#building-the-drivers)
      2. this tutorial (https://www.seppemagiels.com/blog/create-mysql-driver-qt5-windows)

      but can't compile MySQL drivers..

      in the first case (1) i have no opt folder then i had this result (MySQL .... no)
      0_1540122325275_QT Doc.PNG

      in the second one (2) this:
      0_1540122866381_tutorial.PNG

      any ideas??

      If it's possible i will use 64 bit however..

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

        What parameters did you pass to configure ?
        You can use the -v option to get more information about what is failing.

        If you currently want to use 64bit MySQL, then you'll have to switch over to Visual Studio or build Qt yourself in 64 bit for MinGW.

        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
        • TheCipo76T Offline
          TheCipo76T Offline
          TheCipo76
          wrote on last edited by TheCipo76
          #7

          i will use 32 bit ..

          i've built my project (from QT Creator) and then used windeployqt to create a standalone windows app..

          app was loaded well.. but i still have the "Driver not loaded" problem (MySQL)
          (both my dev machine with Qt dir renamed, and in an other machine with windows 10).

          how can i solve it??

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

            Did you check that you have the MySQL dll also deployed ?

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

            TheCipo76T 1 Reply Last reply
            0
            • SGaistS SGaist

              Did you check that you have the MySQL dll also deployed ?

              TheCipo76T Offline
              TheCipo76T Offline
              TheCipo76
              wrote on last edited by TheCipo76
              #9

              @SGaist no dll (because is 3rd part??)
              i've tried to copy the dll in the folder of exe file but don't work!

              now i removed mysql and re-download and extract it.
              i've followed the qt documentation (http://doc.qt.io/qt-5/sql-driver.html#qmysql)
              but i've this problem:

              1. cd %QTDIR%\qtbase\src\plugins\sqldrivers
                impossible to find specified path

                i went manually to the path
                C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers

              2. run:
                qmake -- MYSQL_INDIR=C:/PROGRA~2/MySQL/MYSQLS~1.5/include "MYSQL_LIBDIR=C:\PROGRA~2\MySQL\MYSQLS~1.5\lib"

              3. mingw-make sub-mysql
                give me this result:
                mingw32-make: *** No rule to make target 'sub-mysql'. Stop

              I think that is difficulto to build this plugin.. i've already tried many times but i can't go out of gallery!!

              i've searched mysql file, found in:

              mysql.h ---> C:\Program Files (x86)\MySQL\MySQL Server 5.5\include
              mysql.lib ---> C:\Program Files (x86)\MySQL\MySQL Server 5.5\lib

              Any help??

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

                Something's not clear, didn't you have that running properly before deployment ?

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

                TheCipo76T 1 Reply Last reply
                0
                • SGaistS SGaist

                  Something's not clear, didn't you have that running properly before deployment ?

                  TheCipo76T Offline
                  TheCipo76T Offline
                  TheCipo76
                  wrote on last edited by TheCipo76
                  #11

                  @SGaist yes it'ok run very well

                  i've built it with Qt Creator
                  then i have used windeployqt
                  all it's ok
                  but when i try to rename Qt folder don't work
                  and show the message i've post

                  can i do any check to verify which is the problem?

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

                    If your application runs properly when using Qt Creator, it's likely that you are missing the MySQL .dll (as in the dependencies of the plugin).

                    Use Dependency Walker to check that.

                    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
                    • TheCipo76T Offline
                      TheCipo76T Offline
                      TheCipo76
                      wrote on last edited by TheCipo76
                      #13

                      i'm trying with this :

                      https://wiki.qt.io/Deploy_an_Application_on_Windows

                      i've copy files and folders from

                      mingw../bin (all dll files)
                      mingw../plugins (all folders)

                      to my app folder

                      i've renamed "Qt" in "xxxQt" (to hide Qt folder)

                      lauched my app (works) and delete all dll (some dll was not deleted..)

                      i have deleted all dll files folder by folder

                      it isn't the correct way i think but seem it works now..

                      1 Reply Last reply
                      0
                      • R Offline
                        R Offline
                        rch_shukla
                        wrote on last edited by
                        #14

                        hello
                        I have completed mysql driver loading. it loaded successfully but new problem arises ,mysql plugin is failed with qt.I have tried all the solution provided on google yet not succeeded.
                        Any idea what am i missing here.
                        I am using qt 5.10.1,windows 10,mysql 32 bit.
                        #include "mainwindow.h"
                        #include "ui_mainwindow.h"
                        #include <QSqlRecord>
                        #include<QSqlDriver>
                        #include <QSqlDatabase>
                        #include <qsqldatabase.h>

                        MainWindow::MainWindow(QWidget *parent) :
                        QMainWindow(parent),
                        ui(new Ui::MainWindow)
                        {
                        ui->setupUi(this);

                        QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL","test1");
                        qDebug()<<"running1";
                        
                        QStringList liblist;
                        liblist.push_back("C:/Qt/5.10.1/Src/qtbase/src/plugins/sqldrivers");
                        liblist.push_back("C:/Qt/5.10.1/Src/qtbase/src/plugins");
                        QCoreApplication::setLibraryPaths(liblist);
                        
                        QLibrary mysqllib("libmysql.dll");
                        mysqllib.load();
                        auto t1 = mysqllib.isLoaded();
                        qDebug()<<"my library loaded"<<mysqllib.isLoaded();
                        

                        /////it is working fine till here
                        QPluginLoader plug("qsqlmysqld.dll");
                        plug.load();
                        auto t = plug.isLoaded();
                        //this is failed
                        qDebug()<<"plugin is loaded"<<plug.isLoaded();

                          db.setHostName("127.0.0.1");
                          db.setUserName("root");
                          db.setPassword("Stampsoft2018");
                          db.setDatabaseName("test1");
                          db.setPort(3306);
                          qDebug()<<"running2";
                        

                        // qDebug()<<db.open();
                        // if(!db.open())
                        // {
                        // qDebug()<< "Database error Occurred";
                        // return false;
                        // }

                        // qDebug()<<QSqlDatabase::drivers();
                        if (db.open())
                        {
                        qDebug()<<"DB is opened";
                        QSqlQuery myquery;
                        qDebug()<<"till here..";
                        if (myquery.exec("SELECT name, age, gender FROM employee"))
                        {
                        while (myquery.next())
                        {
                        qDebug() << myquery.value(0) << myquery.value(1) << myquery.value(2);

                                ui->name->setText(myquery.value(0).toString());
                                ui->age->setText(myquery.value(1).toString());
                                ui->gender->setCurrentIndex(myquery.value(2).toInt());
                        
                              }
                            }
                            else
                            {
                              qDebug() << myquery.lastError().text();
                            }
                        
                            db.close();
                          }
                          else
                          {
                            qDebug() << "Failed to connect to database.";
                          }
                        

                        }

                        MainWindow::~MainWindow()
                        {
                        delete ui;
                        }
                        output-
                        running1
                        my library loaded true
                        plugin is loaded false
                        running2
                        Failed to connect to database.

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

                          Hi and welcome to devnet,

                          Did you print the actual error from the QSqlDatabase object ?
                          Did you run your application with the QT_DEBUG_PLUGINS environment variable set to one ?

                          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

                          • Login

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