Important: Please read the Qt Code of Conduct -

[Solved]Linking to QMYSQL driver

  • Hello,

    I recently installed Qt5.5 on a new machine with Ubuntu14.04 amd64 but I cannot load the mysql driver for my application. It is available but not loaded.
    "QSqlDatabase: QMYSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7"

    I used the following way to build the plugin:

    Which worked without any errors, on my older machine I used Qt5.2 (or 5.1 not sure), anyway after that I had to create a symlink to load the driver "sudo ln -s x86_64-linux-gnu/" in /usr/lib

    using ldd in the plugin directory gives the following output: => (0x00007fff597fe000) => /usr/lib/x86_64-linux-gnu/ (0x00007f872309a000) => /home/adi/Qt/5.5/gcc_64/lib/ (0x00007f8722e59000) => /home/adi/Qt/5.5/gcc_64/lib/ (0x00007f8722714000) => /usr/lib/x86_64-linux-gnu/ (0x00007f8722410000) => /lib/x86_64-linux-gnu/ (0x00007f872204a000) => /lib/x86_64-linux-gnu/ (0x00007f8721e31000) => /lib/x86_64-linux-gnu/ (0x00007f8721c2d000) => /lib/x86_64-linux-gnu/ (0x00007f8721a0e000) => /lib/x86_64-linux-gnu/ (0x00007f8721708000) => /lib/x86_64-linux-gnu/ (0x00007f87214f2000) => /home/adi/Qt/5.5/gcc_64/lib/ (0x00007f8721083000) => /home/adi/Qt/5.5/gcc_64/lib/ (0x00007f8720cd5000) => /home/adi/Qt/5.5/gcc_64/lib/ (0x00007f871f2ab000) => /usr/lib/x86_64-linux-gnu/ (0x00007f871f0a8000) => /lib/x86_64-linux-gnu/ (0x00007f871eea0000) => /lib/x86_64-linux-gnu/ (0x00007f871eb98000)
    /lib64/ (0x00007f8723808000) => /lib/x86_64-linux-gnu/ (0x00007f871e959000)

    Any suggestions?

  • I have solved the issue using the following post: