View Full Version : Embedded Mysql Windows Qt4.1

1st June 2006, 08:44

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");
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?

- Pablo.

1st June 2006, 14:44
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?

2nd June 2006, 05:30
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 :(

2nd June 2006, 08:49
And did you link the Qt driver with the embedded library?

2nd June 2006, 10:47
yes of course, that was the first thing I did.

16th January 2007, 13:57
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

16th January 2007, 15:10
Did you place the QMysql Plugin in the correct folder? (i.e. AppPath/plugins/sqldrivers/)

17th January 2007, 00:13
Of course!!