Page 1 of 2 12 LastLast
Results 1 to 20 of 21

Thread: Step by Step MySQL Plugin... what's next step?

  1. #1
    Join Date
    Nov 2006
    Posts
    41
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Step by Step MySQL Plugin... what's next step?

    Hi there, well i have just got the mf mysql plugin now i got in <qtdir>\plugins\sqldrivers\ the holly qsqlmysql.dll what's next for making it work? and dont get the "Driver not loaded" message?
    i guess i have to... configure -plugin-sql-mysql ?
    uhm the -I and -L parameters are needed?
    thanks

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

    Default Re: Step by Step MySQL Plugin... what's next step?

    Install MySQL to a place where Windows (I guess you're using Windows) can find it. You don't need to recompile anything if you already have the dll. If you do that correctly, you shouldn't need to do anything more.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Step by Step MySQL Plugin... what's next step?

    Quote Originally Posted by chaosgeorge View Post
    i guess i have to... configure -plugin-sql-mysql ?
    uhm the -I and -L parameters are needed?
    No, these are required to compile the plugin.

    Did you compile that plugin yourself? Qt might not want to load a plugin that was built using different compiler or for different Qt version. Also make sure that Qt can find all MySQL DLLs (DependencyWalker might be helpful) and search the forum as this topic was discussed already.

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

    Default Re: Step by Step MySQL Plugin... what's next step?

    ehhh i just did the thing for converting the library to a version mingw can use and i did the make thing in the src\plugins\sqldrivers\mysql so how i use the dependencyWalker or make sure qt finds the dll? and mysql is installed in <root>\mysql
    sorry for the dummie questions
    thanks

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Step by Step MySQL Plugin... what's next step?

    Quote Originally Posted by chaosgeorge View Post
    how i use the dependencyWalker or make sure qt finds the dll?
    Just run it, open qsqlmysql.dll and it should tell you whether it could find all DLLs or not. Then you will have to copy all missing DLLs from \mysql directory to a place where windows will find it (for example to the same directory as the executable).

    Also if you compile your application in debug mode, you need qsqlmysqld.dll instead of qsqlmysql.dll.

  6. #6
    Join Date
    Nov 2006
    Posts
    41
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Step by Step MySQL Plugin... what's next step?

    it says it depends of msjava.dll no luck finding it in my hd, where is it?

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Step by Step MySQL Plugin... what's next step?

    Quote Originally Posted by chaosgeorge View Post
    it says it depends of msjava.dll no luck finding it in my hd, where is it?
    Forget about that one. You should look only for those that are connected to MySQL.

  8. #8
    Join Date
    Nov 2006
    Posts
    41
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Step by Step MySQL Plugin... what's next step?

    ok then i run it i still get the Driver not loaded error from db.lasterror().text using

    Qt Code:
    1. {
    2. QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
    3. ..
    4. db things
    5. ....
    6. if(!db.open()){
    7. QMessageBox::critical(0, QObject::tr("Error"),
    8. db.lastError().text());
    9. return false;
    10. }
    11. }
    To copy to clipboard, switch view to plain text mode 

  9. #9
    Join Date
    Nov 2006
    Posts
    41
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Step by Step MySQL Plugin... what's next step?

    By the way QSqlDatabase::drivers(); returns just QSQLITE, QODBC3, QODBC is that ok?

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

    Default Re: Step by Step MySQL Plugin... what's next step?

    Quote Originally Posted by chaosgeorge View Post
    By the way QSqlDatabase::drivers(); returns just QSQLITE, QODBC3, QODBC is that ok?
    Yes. It means it is able to use those drivers. Mysql driver is somehow unusable (due to missing dependencies probably) so it is not listed here. Once you fulfill dependencies, QMYSQL will get listed here as well.

  11. #11
    Join Date
    Nov 2006
    Posts
    41
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Step by Step MySQL Plugin... what's next step?

    uhm well actually i got all dependencies ok except msjava.dll but still dont work, what would be the difference using configure to build the plugin? that should work too? using -I ..\mysqlinclude and -L ..\mysqllib\opt

  12. #12
    Join Date
    Nov 2006
    Posts
    41
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Step by Step MySQL Plugin... what's next step?

    the last option didnt work either there are a lot of undefined references at qsql_mysql.cpp when creating library libqsqlmysql.a any ideas? thanks

    o well it worked now, i forgot make-installing the plugin when i built it, so it's now still configuring Qt i guess it will take some minutes... but i have a question, i just deleted the qsqlite.dll from the plugins directory (just to see what happened ) but databases() still returned the driver is loaded why is that?
    Last edited by chaosgeorge; 4th November 2006 at 20:29.

  13. #13
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Step by Step MySQL Plugin... what's next step?

    Quote Originally Posted by chaosgeorge View Post
    ok then i run it i still get the Driver not loaded error from db.lasterror().text using

    Qt Code:
    1. {
    2. QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
    3. ...
    4. }
    To copy to clipboard, switch view to plain text mode 
    Do you create QCoreApplication or QApplication instance before you try to use the database?

  14. #14
    Join Date
    Nov 2006
    Posts
    41
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Step by Step MySQL Plugin... what's next step?

    uhm yes i guess i use a function in a class to test the connection but after QApplication

    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3.  
    4. QApplication a(argc, argv);
    5. Q_INIT_RESOURCE(resources);
    6. CMain w;
    7.  
    8. if( !w.createConnection() )
    9. return 1;
    10. w.show();
    11. a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
    12. return a.exec();
    13.  
    14. }
    To copy to clipboard, switch view to plain text mode 

  15. #15
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Step by Step MySQL Plugin... what's next step?

    Quote Originally Posted by chaosgeorge View Post
    uhm yes i guess i use a function in a class to test the connection but after QApplication
    QCoreApplication is responsible for plugin loading, so if you won't create QCoreApplication or QApplication plugins won't be accessible.

    Have you seen any references to MySQL DLLs in Dependency Walker?

  16. #16
    Join Date
    Nov 2006
    Posts
    41
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Step by Step MySQL Plugin... what's next step?

    Have you seen any references to MySQL DLLs in Dependency Walker?
    Yes i got all references in my release directory and the mysql dll but no luck
    QCoreApplication is responsible for plugin loading, so if you won't create QCoreApplication or QApplication plugins won't be accessible.
    so i must use QCoreApplication instead of QApplication?

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

    Default Re: Step by Step MySQL Plugin... what's next step?

    Quote Originally Posted by chaosgeorge View Post
    so i must use QCoreApplication instead of QApplication?
    QApplication inherits QCoreApplication.

  18. #18
    Join Date
    Nov 2006
    Posts
    41
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Step by Step MySQL Plugin... what's next step?

    ok i made the plugin through make and by configure but no success loading it by Qt any ideas?

  19. #19
    Join Date
    Nov 2006
    Posts
    41
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default

    Oh my wtf hmfs this at least!!!!!!!!!!!!!! i got it!!!!!!!!!!! the problem was... uhm i dont know what it was but i reinstalled mysql, "mingw-ized" the libs "make-ized" the libs to build the plugin "make-installed" the plugin and taratatannn Qt loaded the driver !!!!!! the last option is what worked at least damn o well now i have to solve connection problems to my remote server LOL thanks everyone

    uhm wtf uhm it looks like it only works in the visual studio command prompt environment in qt command prompt it loads the driver but i get the driver not loaded error right after any ideas? by the way i used nmake instead of make
    Last edited by wysota; 5th November 2006 at 09:13. Reason: Merged two posts sent in a short period of time.

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

    Default Re: Step by Step MySQL Plugin... what's next step?

    You are missing some environment variables (from MySQL?) and you probably mixed up two different builds - MSVC (nmake) one and MinGW (make) one.

Similar Threads

  1. MySQL plugin
    By ksqt in forum Installation and Deployment
    Replies: 12
    Last Post: 24th September 2009, 13:26
  2. MySql plugin driver issues
    By stevey in forum Installation and Deployment
    Replies: 11
    Last Post: 20th September 2006, 13:45
  3. 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
  4. Building of MySQL plugin fails
    By janca in forum Installation and Deployment
    Replies: 2
    Last Post: 21st January 2006, 08:23

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.