Embedded Mysql Windows Qt4.1
Hi,
I'm trying to open an embedded mysql database on windows using the qt mysql plugin that I compiled using the libmysqld library.
My qt code is as follows:
db = QSqlDatabase::addDatabase("QMYSQL");
db.setDatabaseName("test");
bool ok = db.open();
db.open() always returns false.
I tried putting the my.ini file into my HOME directory, into c:\ and into my application's directory. I also tried renaming the file to my.cnf and .my.cnf
I even went as far as creating a HOME environment variable to point to these directories and out of sheer desperation I tried a MYSQL_HOME variable.
Any ideas?
Thanks
- Pablo.
Re: Embedded Mysql Windows Qt4.1
I'm not sure if you can use QMYSQL to connect to an embed database server. How do you do it from plain C+libmysqlclient?
Re: Embedded Mysql Windows Qt4.1
In the qt docs it explains how to compile their driver linking it with the embedded mysql library , libmysqld.dll, so it can be done. I'm currently going through the "roll my own" mysql 5.0.22 from the source trying build another libmysqld.dll, this from a hint I read on the mysql forums, it's a long shot but I've nothing else to try. Of course the mysql source has linking errors, such endeavors are never easy :(
Re: Embedded Mysql Windows Qt4.1
And did you link the Qt driver with the embedded library?
Re: Embedded Mysql Windows Qt4.1
yes of course, that was the first thing I did.
Re: Embedded Mysql Windows Qt4.1
Commented #define, compiled -plugin there and visible, but when start program bug reading memory, the question of how to correct initialize /run in the embedded MySql from program, not alone how in the example of the dock MySQL - with #include <mysql.h>?? And what write in the 'HostName??
P.S. Translated with http://translate.google.com/ from Russian
Re: Embedded Mysql Windows Qt4.1
Did you place the QMysql Plugin in the correct folder? (i.e. AppPath/plugins/sqldrivers/)
Re: Embedded Mysql Windows Qt4.1