Results 1 to 4 of 4

Thread: Qt app with MySQL works in developing machine but not in deploying one

  1. #1
    Join Date
    Jan 2015
    Location
    Tremp, Spain
    Posts
    14
    Thanks
    6
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Qt app with MySQL works in developing machine but not in deploying one

    Hi all,

    I have my application, developed with Qt 5.4.1, working with MySQL databases in my dev machine (Ubuntu 12.04 32 bit), but when I deploy it to another (Ubuntu 14.04 32 bit), I get the "Driver not loaded" of death.
    The destination machine has everything installed, namely:


    • MySQL Server 5.5
    • MySQL Client 5.5
    • MySQL client library (libmysqlclient.so.18.0.0), both at sqldrivers folder and /usr/lib/i386-linux-gnu
    • MySQL plugin (libqsqlmysql.so) at sqldrivers folder
    • Qt 5.4 libraries, including Qt5Sql.so.5.4.1
    • I've even written a script to export the sqldrivers folder path


    Seemingly there are no missing dependencies, tested with ldd on both my executable and libqsqlmysql.so. Upon request, I can post the results.
    Furthermore, the deploying machine runs PHPmyadmin, so I can access the databases from there.
    There is something else that I'm forgetting?

    Any suggestion will be appreciated. Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt app with MySQL works in developing machine but not in deploying one

    You can try running your application in an environment that has variable QT_DEBUG_PLUGINS set to 1, making Qt's plugin loading code log what it is doing.

    Possible causes can be things like a plugin of a different Qt version being found before the correct one.

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    Laureta (12th April 2015)

  4. #3
    Join Date
    Jan 2015
    Location
    Tremp, Spain
    Posts
    14
    Thanks
    6
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Qt app with MySQL works in developing machine but not in deploying one

    Quote Originally Posted by anda_skoa View Post
    You can try running your application in an environment that has variable QT_DEBUG_PLUGINS set to 1
    Well, I did that; and the first thing I saw was that I was using a debug plugin.
    It's my fault, my laziness, I tried to compile the plugin from Qt Creator without realizing it was in debug mode !!!!
    So, I rolled my sleeves up to find the libraries and headers through the file system, and finally I get compiled the plugin from console.

    These are the log's relevant parts on my dev machine (working) log.txt
    And this is the complete log on the deploy machine log_deploy.txt
    Here you can see the application's folder tree on the deploy machine folders_snapshot.png

    As you can see, the mysql plugin is not loaded on deploy machine. What might be the cause?

    Also, I get a warning when platform plugin is loaded: the plugin <path-to-application-platforms> libqxcb.so uses incompatible Qt library (5.4.1) [release].

    In deploy machine, there are Qt 4.8 and Qt 5.1 shared libraries (at /usr/lib/i386-linux-gnu). How can I force to load the libraries distributed with my application, instead of those earlier?

  5. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt app with MySQL works in developing machine but not in deploying one

    You can set an override search path for the runtime linker using the LD_LIBRARY_PATH environment variable in your start script:
    Qt Code:
    1. export LD_LIBRARY_PATH=/your/library/path:$LD_LIBRARY_PATH
    To copy to clipboard, switch view to plain text mode 

    If you do that in a shell, ldd will also use it, so you can verify which Qt is picked up for your application.

    Cheers,
    _

  6. The following user says thank you to anda_skoa for this useful post:

    Laureta (13th April 2015)

Similar Threads

  1. No printer after deploying application on another machine
    By worluk in forum Installation and Deployment
    Replies: 1
    Last Post: 13th November 2013, 09:39
  2. Replies: 3
    Last Post: 5th June 2013, 05:35
  3. Replies: 4
    Last Post: 11th June 2010, 19:27
  4. Deploying with MySQL and FTP
    By josepvr in forum Qt Programming
    Replies: 2
    Last Post: 9th April 2009, 08:16
  5. Deploying application on Linux machine without Qt
    By will49 in forum Installation and Deployment
    Replies: 2
    Last Post: 10th July 2008, 22:41

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.