Win 10 drivers mysql not load
-
I don't either because you didn't post the actual error.
-
After download MySQL community 5.5.61 Win32
i've tried following:- Qt Documentation (http://doc.qt.io/qt-5/sql-driver.html#building-the-drivers)
- 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)
in the second one (2) this:
any ideas??
If it's possible i will use 64 bit however..
-
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.
-
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??
-
Did you check that you have the MySQL dll also deployed ?
-
@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:-
cd %QTDIR%\qtbase\src\plugins\sqldrivers
impossible to find specified pathi went manually to the path
C:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers -
run:
qmake -- MYSQL_INDIR=C:/PROGRA~2/MySQL/MYSQLS~1.5/include "MYSQL_LIBDIR=C:\PROGRA~2\MySQL\MYSQLS~1.5\lib" -
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\libAny help??
-
-
Something's not clear, didn't you have that running properly before deployment ?
-
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.
-
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..
-
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. -
Hi and welcome to devnet,
Did you print the actual error from the QSqlDatabase object ?
Did you run your application with theQT_DEBUG_PLUGINS
environment variable set to one ?