Results 1 to 8 of 8

Thread: Embedded Mysql Windows Qt4.1

  1. #1
    Join Date
    May 2006
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question 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.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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?

  3. #3
    Join Date
    May 2006
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Embedded Mysql Windows Qt4.1

    And did you link the Qt driver with the embedded library?

  5. #5
    Join Date
    May 2006
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Embedded Mysql Windows Qt4.1

    yes of course, that was the first thing I did.

  6. #6
    Join Date
    Feb 2006
    Posts
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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

  7. #7
    Join Date
    May 2006
    Location
    Germany
    Posts
    108
    Thanks
    2
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Embedded Mysql Windows Qt4.1

    Did you place the QMysql Plugin in the correct folder? (i.e. AppPath/plugins/sqldrivers/)

  8. #8
    Join Date
    Feb 2006
    Posts
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Embedded Mysql Windows Qt4.1

    Of course!!

Similar Threads

  1. Problems building mysql plugin for Qt 4.1.2 on windows XP
    By Philip_Anselmo in forum Installation and Deployment
    Replies: 3
    Last Post: 17th May 2006, 15:38
  2. issues compiling Qt4.1 with mysql
    By patcito in forum Qt Programming
    Replies: 6
    Last Post: 6th March 2006, 22:41
  3. Can't install Qt4.1 with SQL Support for ODBC in Windows XP
    By danieltruchsess in forum Installation and Deployment
    Replies: 1
    Last Post: 5th February 2006, 10:02
  4. Qt 4.1 OS on Windows & mysql
    By neeko in forum Installation and Deployment
    Replies: 10
    Last Post: 31st January 2006, 20:22
  5. Qt and windows vista
    By munna in forum General Discussion
    Replies: 8
    Last Post: 11th January 2006, 22:33

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.