I want to use QMYSQL.
What are the driver installation files I need to install to work with my Qt4.6.2
and where can i get it?
Which version of QMYSQL I need to use ?
What are the procedures?
I want to use QMYSQL.
What are the driver installation files I need to install to work with my Qt4.6.2
and where can i get it?
Which version of QMYSQL I need to use ?
What are the procedures?
Read this guide.
babygal (27th July 2010)
I'm not able to execute the command 'reimp' as per the instruction in the link . And where can I get the download files for the reimp?
Goto the sub-directory lib/opt and run reimp libmysql.lib to produce the liblibmysql.a file. This is the import library to use with MinGW.
You can download mingw-utils in http://sourceforge.net/projects/ming...ar.gz/download or http://sourceforge.net/projects/ming....lzma/download.
babygal (27th July 2010)
How can I be sure that the driver files are installed correctly?
You can use QSqlDatabase::drivers() to check all of the available drivers.
The debug message reads as:Qt Code:
int main(int argc, char *argv[]) { if (!createConnection()) return 1; Q_INIT_RESOURCE(cardiacprocessingtoolkit); MainWindow mainWin; mainWin.show(); return app.exec(); }To copy to clipboard, switch view to plain text mode
("QSQLITE", "QMYSQL3", "QMYSQL", "QODBC3", "QODBC")
but the connection fails ! what's wrong?
Qt Code:
static bool createConnection() { db.setHostName("localhost"); db.setDatabaseName("DatabaseName"); if (!db.open()) { qApp->tr("Unable to establish a database connection.\n" "This example needs MYSQL support. Please read " "the Qt SQL driver documentation for information how " "to build it.\n\n" return false; } return true; }To copy to clipboard, switch view to plain text mode
Can you connect to your MySQL server using MySQL client (mysql.exe) without username and password? Make sure your database "DatabaseName" exist and MySQL service is running.
Then probably you have to start your server!
take the MySQL Community Server. It will have all necessary files.
I download the mingw-utils in http://sourceforge.net/projects/ming...ar.gz/download .
As per the guide : http://www.qtcentre.org/wiki/index.p...ws_using_MinGW
the second prerequisite is : Download the mingw-utils .Copy the contents of the binary tar.gz to %QTDIR%/bin.
My question is which bin folder exactly?There are a few bin folders. QT version I'm using is 2010.02.1
I assume your Qt installation is in C:\. So, copy your mingw-utils contents(in bin directory) in C:\Qt\2010.02.1\qt\bin.
I downloaded the MySQL Server 5.1 into path
C:\Program Files\MySQL\MySQL Server 5.1 .
But there is no \lib\opt\ in my :
C:\Program Files\MySQL\MySQL Server 5.1\lib.
Instruction from the guide link :-
But I do not find any sub-directory lib/opt . So how do I proceed?How to Build the Plug-in :
-Open a Qt Command Prompt and go to wherever you installed the MySQL server (C:\Program Files\MySQL\MySQL Server 5.0 is the default location).
-Goto the sub-directory lib/opt and run reimp libmysql.lib to produce the liblibmysql.a file. This is the import library to use with MinGW.
Is there libmysql.lib in your MySQL lib directory ?
Bookmarks