Error Loading MySql Driver in 4.3.4
Hello,
I've modified one of the Sql connector examples included with the Qt installation to connect to a mysql database. I'm using the eval version with MSVS 2005. The code compiles but when I try to call createConnection() I get a "Driver Not Loaded" error. The main thing I don't understand is that this worked under 4.3.3 but breaks now, even though 4.3.4 is completely backwards compatible. Here's the code. Thanks in advance.
Code:
#ifndef MYSQL_CONNECTION_H
#define MYSQL_CONNECTION_H
#include <QMessageBox>
#include <QSqlDatabase>
#include <QSqlError>
#include <QSqlQuery>
#include <QString>
#include <QStringList>
static bool createConnection()
{
db.setDatabaseName("scheduling");
db.setHostName("127.0.0.1");
db.setUserName("root");
db.setPassword("dora");
if (!db.open()) {
"Unable to establish a database connection. " + db.lastError().text() + ".\n\n\n"
return false;
}
return true;
}
#endif
Re: Error Loading MySql Driver in 4.3.4
Quote:
Originally Posted by
perrigo
Hello,
I've modified one of the Sql connector examples included with the Qt installation to connect to a mysql database. I'm using the eval version with MSVS 2005. The code compiles but when I try to call createConnection() I get a "Driver Not Loaded" error. The main thing I don't understand is that this worked under 4.3.3 but breaks now, even though 4.3.4 is completely backwards compatible. Here's the code. Thanks in advance.
#endif
if you run demo application
Qt/4.3.3_src/demos/sqlbrowser/release
you can see all loaded Driver if see QMYSQL driver can work otherwise have a look on wiki to install...
Re: Error Loading MySql Driver in 4.3.4
QMYSQL isn't among the options in the "Driver" combo box. Only QSQLITE, QODBC, and QPSQL are available.
Re: Error Loading MySql Driver in 4.3.4
I have exactly the same problem.
Re: Error Loading MySql Driver in 4.3.4
Quote:
Originally Posted by
Tiansen
I have exactly the same problem.
i try 4 week a go on Microsoft Visual Studio 2008 beta the qt build -qt-sql-mysql run and work.. but now i use a MingW compiler qt build ( less dll )
grab mingw compiler from ftp://ftp.trolltech.com/qt/source/qt...eta1-mingw.exe
and build ftp://ftp.trolltech.com/qt/source/qt...-src-4.3.0.zip -qt-sql-mysql
like http://wiki.qtcentre.org/index.php?t...ws_using_MinGW
Re: Error Loading MySql Driver in 4.3.4
You see, I would rather solve my problem than avoid it. I'm using VS 2005 and would like for the code to work. The exact same code ran correctly in 4.3.3. If anyone has gotten the MySql driver to load please include a bit of sample code. Thanks.