Solved QSqlDatabase: QMYSQL driver not loaded (ubuntu x64 | QT 5.6.1)
-
I have a problem loading QMYSQL driver please someone help..
QSqlDatabase db(QSqlDatabase::addDatabase("QMYSQL")); db.setDatabaseName("my_db"); db.setHostName("localhost"); db.setUserName("root"); db.setPassword("chawila"); if (db.open()) { qDebug() << "SUCCESS!"; db.close(); }else{ qDebug() << "failed"; }
-
@chawila
https://forum.qt.io/topic/63335/qsqldatabase-qmysql-driver-not-loadedI had the same problem earlier and this video was helpful for me.
https://www.youtube.com/watch?v=rjp2msIfalE -
@L.Gogs
yah. let me check that.. -
eish.
i tried that, but i have a problem with these:*"That's because you don't have the Qt sources installed. Use maintenancetool to download them."*
i dont know how to install Qt sources with maintenance tools.
how did you do it?..
-
-
hold on i`m trying.....
-
@chawila
try like this
https://www.youtube.com/watch?v=-kq1J1WkmxM -
I`m downloading a very huge file here.
440mb
is called :
qt-everywhere-opensource-src-5.9.1.tar.xz
so i dont know if i`m doing the right thing here..
because accoding to that guy: sgaist, i was suppose to use maintenance tool==================================================
for that youtube video, it did`nt work.
-
Hi,
There are several ways to download the sources. One of the most simple is the Maintenance Tool, otherwise you have git and archives.
However there's something fishy here, you wrote Qt 5.6.1 in your title and you seem to be downloading Qt 5.9.1, which is it ?
-
Hi, thanks for commenting..
i`m using QT-5.6.1so i just clicked download source, i dnt know if i had to choos,
wat can i do now?..and if posible, i`d like if u can help me downloading from the maintenance tool, because im required to add repositories and i tried but i get error:
"there is a problem with your repositories." -
@chawila Well, you need to download the correct version.
What about http://download.qt.io/official_releases/qt/5.6/5.6.1/single/qt-everywhere-opensource-src-5.6.1.tar.xz ? -
@jsulm
Thanks for commenting.
but i have reinstalled ubuntu(for personal reasons) then install Qt5.9.1.add i tried to copy location like you said.
http://download.qt.io/official_releases/qt/5.9/5.9.1/single/qt-everywhere-opensource-src-5.9.1.tar.xz
but it is not working.I got this error:
Anywhere.
now that i have the sources let me try to follow the documentation..
i`ll get back..... -
Do i have to install sources at the same "/opt/Qt5.9.1" directory of Qt that i already have
or i can just install it anywhere?... -
@chawila
anywhere. i have mine in my home folder as i want the example dir to be writable.
But only if u are sole user of machine. -
@mrjj
thanks.
let me trybut during installation of Qt i saw sources under the drop down.
so i`m wondering why do i have to add them againg... -
chawila@coder:/opt/Qt5.9.1/5.9.1/gcc_64/plugins/sqldrivers$ ldd libqsqlmysql.so linux-vdso.so.1 => (0x00007ffd873ca000) libQt5Sql.so.5 => /opt/Qt5.9.1/5.9.1/gcc_64/plugins/sqldrivers/./../../lib/libQt5Sql.so.5 (0x00007f2415858000) libQt5Core.so.5 => /opt/Qt5.9.1/5.9.1/gcc_64/plugins/sqldrivers/./../../lib/libQt5Core.so.5 (0x00007f241511e000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2414ee9000) libmysqlclient.so.18 => not found libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f2414b67000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f241485d000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2414647000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f241427e000) libicui18n.so.56 => /opt/Qt5.9.1/5.9.1/gcc_64/plugins/sqldrivers/./../../lib/libicui18n.so.56 (0x00007f2413de4000) libicuuc.so.56 => /opt/Qt5.9.1/5.9.1/gcc_64/plugins/sqldrivers/./../../lib/libicuuc.so.56 (0x00007f2413a2c000) libicudata.so.56 => /opt/Qt5.9.1/5.9.1/gcc_64/plugins/sqldrivers/./../../lib/libicudata.so.56 (0x00007f2412049000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f2411e2e000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2411c2a000) libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f2411a28000) libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f2411716000) /lib64/ld-linux-x86-64.so.2 (0x000055e0828aa000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f24114a6000) chawila@coder:/opt/Qt5.9.1/5.9.1/gcc_64/plugins/sqldrivers$
-
I POSTED A SOLUTION OF THESE PROBLEM AT:
https://forum.qt.io/topic/82400/how-to-create-the-plugin-of-mysql-for-qt-linux