Results 1 to 3 of 3

Thread: building a plugin for MySql

  1. #1

    Default building a plugin for MySql

    Hello,


    I'm starting with Qt4.5 and i am using QtCreator in ubuntu.

    I want to develop an application that will interact with a Mysql DB, and i am having troubles with that...

    In my /usr/lib/qt4/plugins/sqldrivers i only have libqsqlite.so so i gess i need to build one for mysql. I have searched already and if i understood right i only found solutions that need to repeat all the installation process for Qt.(e: http://doc.trolltech.com/4.5/sql-driver.html#qmysql)

    Is it possible to build a plugin QMySql for MySql in a diferent way?

    thanks in advance,

    Paulo

  2. #2
    Join Date
    Mar 2009
    Posts
    19
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: building a plugin for MySql

    If you're using the version installed via your OS's package manager, the MySQL plugin will be an installable module you can select and install with a few clicks. Sorry, not an Ubuntu user so I can't tell you specifically what to run to do the job. Maybe apt-get, I'm not sure.

    Be advised that the MySQL driver provided with Qt 4.5 appears to be buggy and broken (apparently tries to execute all queries first as 'prepared queries' and does not correctly fall back for queries unsupported by the 'prepared' protocol -- you wind up getting MySQL 1295 errors from QSqlQuery::lastError() when there should be no error).

    If you are going to do MySQL work with Qt for now I would encourage you to ditch 4.5 and fall back to 4.4.3. Installation isn't that hard and only requires you set your path to its bindir to use.

    The following worked for me:

    as regular user
    Qt Code:
    1. ./configure -qt-sql-mysql -system-sqlite
    To copy to clipboard, switch view to plain text mode 

    as regular user
    Qt Code:
    1. make
    To copy to clipboard, switch view to plain text mode 

    as root
    Qt Code:
    1. make install
    To copy to clipboard, switch view to plain text mode 

  3. #3

    Default Re: building a plugin for MySql

    First of all, thanks for the attention,

    well i have solved the problem before i have the chance to read your answer.

    All i have done was generate the plugin QMySql from the qt source code and than copy it to my qt SqlDrivers folder and it works...



    Paulo

Similar Threads

  1. Problem building dynamic plugin
    By javd in forum Qt Programming
    Replies: 3
    Last Post: 6th April 2009, 18:02
  2. building plugin for mysql?
    By triperzonak in forum Installation and Deployment
    Replies: 1
    Last Post: 25th June 2008, 08:57
  3. QPluginLoader not recognizing a plugin
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 29th June 2007, 14:13
  4. 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
  5. 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.