QMYSQL - Ubuntu 18.04.1
-
wrote on 29 Oct 2018, 19:52 last edited by
Sorry if I'm an idiot. I'm having issues using the MySQL features in qt.
Getting an error on a project:
QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7
Here's the output of ldd
~/Qt/5.11.2/gcc_64/plugins/sqldrivers$ ldd libqsqlmysql.so linux-vdso.so.1 (0x00007ffc87f8b000) libQt5Sql.so.5 => /home/matthew/Qt/5.11.2/gcc_64/plugins/sqldrivers/./../../lib/libQt5Sql.so.5 (0x00007f746fd5a000) libQt5Core.so.5 => /home/matthew/Qt/5.11.2/gcc_64/plugins/sqldrivers/./../../lib/libQt5Core.so.5 (0x00007f746f600000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f746f3e1000) libmysqlclient.so.18 => not found libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f746f058000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f746ecba000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f746eaa2000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f746e6b1000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f746e494000) libicui18n.so.56 => /home/matthew/Qt/5.11.2/gcc_64/plugins/sqldrivers/./../../lib/libicui18n.so.56 (0x00007f746dffb000) libicuuc.so.56 => /home/matthew/Qt/5.11.2/gcc_64/plugins/sqldrivers/./../../lib/libicuuc.so.56 (0x00007f746dc43000) libicudata.so.56 => /home/matthew/Qt/5.11.2/gcc_64/plugins/sqldrivers/./../../lib/libicudata.so.56 (0x00007f746c260000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f746c05c000) libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f746be5a000) libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f746bb44000) /lib64/ld-linux-x86-64.so.2 (0x00007f74701b5000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f746b8d2000)
I'm wondering if it is a version mismatch for the client libraries and I'm too ignorant to fix it? I do have these files.
/usr/lib/x86_64-linux-gnu/libmysqlclient.so.20 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20.3.11
Thanks in advance to anyone that can help.
-
Sorry if I'm an idiot. I'm having issues using the MySQL features in qt.
Getting an error on a project:
QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7
Here's the output of ldd
~/Qt/5.11.2/gcc_64/plugins/sqldrivers$ ldd libqsqlmysql.so linux-vdso.so.1 (0x00007ffc87f8b000) libQt5Sql.so.5 => /home/matthew/Qt/5.11.2/gcc_64/plugins/sqldrivers/./../../lib/libQt5Sql.so.5 (0x00007f746fd5a000) libQt5Core.so.5 => /home/matthew/Qt/5.11.2/gcc_64/plugins/sqldrivers/./../../lib/libQt5Core.so.5 (0x00007f746f600000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f746f3e1000) libmysqlclient.so.18 => not found libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f746f058000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f746ecba000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f746eaa2000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f746e6b1000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f746e494000) libicui18n.so.56 => /home/matthew/Qt/5.11.2/gcc_64/plugins/sqldrivers/./../../lib/libicui18n.so.56 (0x00007f746dffb000) libicuuc.so.56 => /home/matthew/Qt/5.11.2/gcc_64/plugins/sqldrivers/./../../lib/libicuuc.so.56 (0x00007f746dc43000) libicudata.so.56 => /home/matthew/Qt/5.11.2/gcc_64/plugins/sqldrivers/./../../lib/libicudata.so.56 (0x00007f746c260000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f746c05c000) libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f746be5a000) libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f746bb44000) /lib64/ld-linux-x86-64.so.2 (0x00007f74701b5000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f746b8d2000)
I'm wondering if it is a version mismatch for the client libraries and I'm too ignorant to fix it? I do have these files.
/usr/lib/x86_64-linux-gnu/libmysqlclient.so.20 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20.3.11
Thanks in advance to anyone that can help.
@mbyrd777
Hi and welcome to the forums.It seems it tried to load the
libmysqlclient.so.18
but yours is named
libmysqlclient.so.20You could try to make a sym link from the
libmysqlclient.so.18 ( as name ) to libmysqlclient.so.20ln -sf /usr/lib/libmysqlclient.so.20 /usr/lib/libmysqlclient.so.18
CHECK the man page. im known to always switch target and the sym name.
i cant promise it will work but there is a good chance its compatible.
If not, its just a link, so should not blow up anything. (much) -
@mbyrd777
Hi and welcome to the forums.It seems it tried to load the
libmysqlclient.so.18
but yours is named
libmysqlclient.so.20You could try to make a sym link from the
libmysqlclient.so.18 ( as name ) to libmysqlclient.so.20ln -sf /usr/lib/libmysqlclient.so.20 /usr/lib/libmysqlclient.so.18
CHECK the man page. im known to always switch target and the sym name.
i cant promise it will work but there is a good chance its compatible.
If not, its just a link, so should not blow up anything. (much)wrote on 29 Oct 2018, 20:47 last edited by mbyrd777@mrjj That's sort of what I was thinking but I didn't want to cause any sort of unintended consequences and didn't know if there was an official way to handle library differences. Thanks for the tip
edit: the symlink didn't seem to work as the same error occurred.
-
@mrjj That's sort of what I was thinking but I didn't want to cause any sort of unintended consequences and didn't know if there was an official way to handle library differences. Thanks for the tip
edit: the symlink didn't seem to work as the same error occurred.
@mbyrd777
Hi
Well I have done that with various other libs and had no ill side effects as
its sort of just makes an alias for the lib.
However, it it really wants the .18 version, the app might crash but
the link can easy be removed so i find the risk very small for anything bad system wise.Update:
ok. thats odd. I recall a case where it look in the "wrong"/other folder
/lib/x86_64 and not in /usr/lib/Im not super linux experct so lets wait some hours, some of the others mods are very into
linux :) -
@mbyrd777
Hi
Well I have done that with various other libs and had no ill side effects as
its sort of just makes an alias for the lib.
However, it it really wants the .18 version, the app might crash but
the link can easy be removed so i find the risk very small for anything bad system wise.Update:
ok. thats odd. I recall a case where it look in the "wrong"/other folder
/lib/x86_64 and not in /usr/lib/Im not super linux experct so lets wait some hours, some of the others mods are very into
linux :) -
Sorry if I'm an idiot. I'm having issues using the MySQL features in qt.
Getting an error on a project:
QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7
Here's the output of ldd
~/Qt/5.11.2/gcc_64/plugins/sqldrivers$ ldd libqsqlmysql.so linux-vdso.so.1 (0x00007ffc87f8b000) libQt5Sql.so.5 => /home/matthew/Qt/5.11.2/gcc_64/plugins/sqldrivers/./../../lib/libQt5Sql.so.5 (0x00007f746fd5a000) libQt5Core.so.5 => /home/matthew/Qt/5.11.2/gcc_64/plugins/sqldrivers/./../../lib/libQt5Core.so.5 (0x00007f746f600000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f746f3e1000) libmysqlclient.so.18 => not found libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f746f058000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f746ecba000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f746eaa2000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f746e6b1000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f746e494000) libicui18n.so.56 => /home/matthew/Qt/5.11.2/gcc_64/plugins/sqldrivers/./../../lib/libicui18n.so.56 (0x00007f746dffb000) libicuuc.so.56 => /home/matthew/Qt/5.11.2/gcc_64/plugins/sqldrivers/./../../lib/libicuuc.so.56 (0x00007f746dc43000) libicudata.so.56 => /home/matthew/Qt/5.11.2/gcc_64/plugins/sqldrivers/./../../lib/libicudata.so.56 (0x00007f746c260000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f746c05c000) libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f746be5a000) libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f746bb44000) /lib64/ld-linux-x86-64.so.2 (0x00007f74701b5000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f746b8d2000)
I'm wondering if it is a version mismatch for the client libraries and I'm too ignorant to fix it? I do have these files.
/usr/lib/x86_64-linux-gnu/libmysqlclient.so.20 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20.3.11
Thanks in advance to anyone that can help.
@mbyrd777 said in QMYSQL - Ubuntu 18.04.1:
Sorry if I'm an idiot.
You're not. :)
I'm wondering if it is a version mismatch for the client libraries and I'm too ignorant to fix it? I do have these files.
It is a version mismatch. You need to provide the correct library for the plugin. Did you build Qt yourself?
Most painless would be to just install the correct client library from the repo though. -
@mbyrd777 said in QMYSQL - Ubuntu 18.04.1:
Sorry if I'm an idiot.
You're not. :)
I'm wondering if it is a version mismatch for the client libraries and I'm too ignorant to fix it? I do have these files.
It is a version mismatch. You need to provide the correct library for the plugin. Did you build Qt yourself?
Most painless would be to just install the correct client library from the repo though.wrote on 29 Oct 2018, 23:56 last edited by@kshegunov I downloaded the community edition installer today and ran it to install 5.11.2
I didn't build from source -
@kshegunov I downloaded the community edition installer today and ran it to install 5.11.2
I didn't build from sourceOkay, I suggest you install
libmysqlclient18
from the repo, which should fix your problem. -
Okay, I suggest you install
libmysqlclient18
from the repo, which should fix your problem.wrote on 30 Oct 2018, 11:51 last edited by@kshegunov said in QMYSQL - Ubuntu 18.04.1:
libmysqlclient18
$ sudo apt-get install libmysqlclient18 [sudo] password for matthew: Reading package lists... Done Building dependency tree Reading state information... Done Package libmysqlclient18 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'libmysqlclient18' has no installation candidate
-
@kshegunov said in QMYSQL - Ubuntu 18.04.1:
libmysqlclient18
$ sudo apt-get install libmysqlclient18 [sudo] password for matthew: Reading package lists... Done Building dependency tree Reading state information... Done Package libmysqlclient18 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'libmysqlclient18' has no installation candidate
https://packages.ubuntu.com/search?keywords=libmysqlclient&searchon=names&suite=trusty§ion=all
I don't pretend to understand the Ubuntu release cycle, as I work on debian. However as I see it, you have to pin the trusty repositories with a low priority in the apt configuration, and then you can install it.
-
@kshegunov said in QMYSQL - Ubuntu 18.04.1:
libmysqlclient18
$ sudo apt-get install libmysqlclient18 [sudo] password for matthew: Reading package lists... Done Building dependency tree Reading state information... Done Package libmysqlclient18 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'libmysqlclient18' has no installation candidate
wrote on 30 Oct 2018, 16:09 last edited by JonB@mbyrd777
Let's start a little bit from scratch here.Why do you want/need any kind of "libmysqlclient18", I mean the
18
instead of the20
?I installed Ubuntu 18.04 from fresh yesterday. Everything default. I get all my Qt/MySQL stuff from the repo, with standard
apt-get
(e.g.apt-get install qt5-default
). I do not get source code or compile anything.Mine works fine, without any issues. I have no "libmysqlclient18" anywhere. I have
libmysqlclient.so.20
(libmysqlclient.so.20.3.11
actually).Now, the point is, if anything my Qt/MySQL will be older than yours (e.g. it's Qt 5.9.5), and yet I'm up to
libmysqlclient.so.20
. So where does your need for18
come from?P.S.
I notice I did aapt-get install libqt5sql5-mysql
. Do you do that one? -
@mbyrd777
Let's start a little bit from scratch here.Why do you want/need any kind of "libmysqlclient18", I mean the
18
instead of the20
?I installed Ubuntu 18.04 from fresh yesterday. Everything default. I get all my Qt/MySQL stuff from the repo, with standard
apt-get
(e.g.apt-get install qt5-default
). I do not get source code or compile anything.Mine works fine, without any issues. I have no "libmysqlclient18" anywhere. I have
libmysqlclient.so.20
(libmysqlclient.so.20.3.11
actually).Now, the point is, if anything my Qt/MySQL will be older than yours (e.g. it's Qt 5.9.5), and yet I'm up to
libmysqlclient.so.20
. So where does your need for18
come from?P.S.
I notice I did aapt-get install libqt5sql5-mysql
. Do you do that one?@JonB said in QMYSQL - Ubuntu 18.04.1:
Why do you want/need any kind of "libmysqlclient18", I mean the 18 instead of the 20?
Because the plugin he got from the installer is built against that version.
I get all my Qt/MySQL stuff from the repo
I do too, however it's not the case here.
I have libmysqlclient.so.20 (libmysqlclient.so.20.3.11 actually).
Thanks to the maintainers of your distro, they take the time to repackage the binaries appropriately and set the correct dependencies, so you (and I) get it out of the box.
-
@JonB said in QMYSQL - Ubuntu 18.04.1:
Why do you want/need any kind of "libmysqlclient18", I mean the 18 instead of the 20?
Because the plugin he got from the installer is built against that version.
I get all my Qt/MySQL stuff from the repo
I do too, however it's not the case here.
I have libmysqlclient.so.20 (libmysqlclient.so.20.3.11 actually).
Thanks to the maintainers of your distro, they take the time to repackage the binaries appropriately and set the correct dependencies, so you (and I) get it out of the box.
wrote on 30 Oct 2018, 17:21 last edited by JonBBecause the plugin he got from the installer is built against that version.
I didn't get that bit. What installer does he talk about in his question?Oh, do you mean in a later post I just noticed:
@kshegunov I downloaded the community edition installer today and ran it to install 5.11.2
Anyway, if it has to be like that. I was just mentioning that if he could manage/do as I have I get all the stuff he mentions just with the
apt-get
s and do not have his issue. Or he can fiddle potentially for days till he sorts out his current situation. It was just a heads-up. -
Because the plugin he got from the installer is built against that version.
I didn't get that bit. What installer does he talk about in his question?Oh, do you mean in a later post I just noticed:
@kshegunov I downloaded the community edition installer today and ran it to install 5.11.2
Anyway, if it has to be like that. I was just mentioning that if he could manage/do as I have I get all the stuff he mentions just with the
apt-get
s and do not have his issue. Or he can fiddle potentially for days till he sorts out his current situation. It was just a heads-up.@JonB said in QMYSQL - Ubuntu 18.04.1:
Oh, do you mean in a later post I just noticed
Indeed.
Anyway, if it has to be like that. I was just mentioning that if he could manage/do as I have I get all the stuff he mentions just with the apt-gets and do not have his issue. Or he can fiddle potentially for days till he sorts out his current situation. It was just a heads-up.
When I'm not needing a Qt build myself (like trying a patch or something) I personally do it just like you described.
1/14