Important: Please read the Qt Code of Conduct -

Raspberry Pi 3 - MySQL client connect error

  • Hi
    OK, I'm new to Linux so struggle a bit to get past all the 'Geek Speak'
    I get the 'dreaded' QMYSQL driver not loaded.

    1. We can connect via PHPAdmin without any issues so all Server side is up and running.
    2. We can log on to MySQL via the console.

    We did the 'sudo' things and everything is installed. (or maybe not?)
    Now, how (rather where) is the file(s) that must be linked in the app. We searched the Pi and net but none of the solutions work - or we are just to spoiled by Windows programming to understand them.


  • Lifetime Qt Champion

    @Adie Did you install MySQL client library?
    Take a look at

  • That is for the WINDOWS solution. My Win10 system works 100% after I just copied the required file to my app folder.

    The issue here is to get a Qt app developed on the Pi (Raspbian) to run. I cant find the Qt OR the MySQL folders on the Pi.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    The question @jsulm wrote still applies. Did you install MySQL on your device ?

  • Read my first post please. (and header)
    Everything is working EXCEPT that I get the now famous "Can not connect to MySQL" with Qt app because the 'client driver' is not available on the Pi.

    I tried all the options I could find on the web. I am developing ON the Pi so no "cross compile'.

    As far as I understand I need to do one of two things

    1. Compile the MySQL client 'driver' and copy that in the Qt App folder.
    2. Compile the driver IN my Qt app.
      I dont care which as long as I can proceed with the development.

    So, All I need is WHERE to get the file(s) and where to copy them.


  • Lifetime Qt Champion

    What version of MySQL do you have installed on your device ?
    What do you get if you run ldd /path/to/Qt/ ?

  • @SGaist said in Raspberry Pi 3 - MySQL client connect error:

    What version of MySQL do you have installed on your device ?
    What do you get if you run ldd /path/to/Qt/ ?

    MySQL server 5.5.55

    The problem is: (Remember I'm 'spoiled' by Microsoft :-( )
    1 dont know where '/path/to/Qt/' is.
    1 dont know the 'real' name for 'mysql_plugin_name'

    If I new those I might have solved the problem :-)

    This is what we have done on the Pi
    1: sudo apt-get install libmysqlclient-dev
    2a: udo apt-get install libmysqlclient-dev
    2b: sudo apt-get install libmysqlcppconn-dev
    3: sudo apt-get build-dep libmysqlcppconn-dev

    Qt is installed and running.
    So based on the above I 'should' have done everything ?
    Like is said above: I can not find the required files on the Pi - maybe because I do not know how to look for it Eg: Qt install path ??

    Thanks Adie

  • Lifetime Qt Champion

    How did you install Qt on your device ?

  • not to worry anymore, gonna ditch the project

    Waay to complex to distribute and maintain applications on Linux.


Log in to reply