Can we work with MySQL?



  • Is there support in Qt SQL for MySql? I don't see a specific driver for this...

    Thanks

    Juan Dent



  • @jdent The driver should be in <INSTALLED FOLDER>/PLUGINs/sqldrivers
    The Name should be something like: qsqlmysql4.dll at least for the QT 4.8x versions.
    If you do not found it, you need to build the QT driver.



  • Ok, looking at that address in m y computer (Mac Pro), I see the following dynamic link libraries (which end in dylib in Apple's OS X system):

    libsqlite_debug.dylib
    libsqlite.dylib
    libsqlmysql_debug.dylib
    libsqlmysql.dylib
    libsqlodbc_debug.dylib
    libsqlodbc.dylib
    libsqlpsql_debug.dylib
    libsqlpsql.dylib

    So, it seems there is a driver for MySql!! But, the enumeration for DbmsType does not include MySQL???

    This seems contradictory..

    Any ideas?

    Juan



  • @blaisesegbeaya

    Where could I find detailed instructions as to how to create a QT driver - should that be necessary??

    Thanks
    Juan


  • Moderators

    @jdent Hi!

    There is no need to write your own MySQL driver. Qt has a plugin for MySQL since very long ago and it's stable and just works and everyone uses it. :-)

    Here is the list of all supported databases. I guess the MySQL plugin can also talk to MariaDB but I'm not sure about that.

    Are you using a precompiled Qt environment or have you compiled Qt youself? If you've built it yourself and you're now missing the MySQL plugin then this is either caused by missing dependencies (MySQL development headers) or misconfiguration during the build process.


  • Lifetime Qt Champion

    Hi,

    The most likely situation: you have either MySQL installed through brew, MacPorts or even from the package on their website and it's not the same version nor the same path than the one used to build Qt.
    Run otool -L on libsqlmysql.dylib to see what's the status.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.