Raspberry PI MYSQL drivers not found Qt Creator

Thread Starter

zazas321

Joined Nov 29, 2015
936
Hello. I have a fresh raspberry PI and followed this guide to make a server on my raspberry PI.
https://howtoraspberrypi.com/how-to-install-web-server-raspberry-pi-lamp/
Everything worked fine and I am able to connect to database through: http://localhost/phpmyadmin

I am using QtCreator to write a program and debug, however I am getting an error that QMYSQL drivers are not loaded.
1593677427336.png


I have managed to find various information how to solve this problem on Windows but since I am using raspberry PI and linux which I do not have any experience with, I would like to ask some help on how can I add MYSQL drivers to QT.
 

Thread Starter

zazas321

Joined Nov 29, 2015
936
Fixed!
Those who are having the same issue:

run following command in terminal to check what plugins you currently got
Code:
ls /usr/lib/arm-linux-gnueabihf/qt5/plugins/sqldrivers
You should have libqsqlmysql.so file in there, if not run following command to install mysql plugin:
Code:
sudo apt-get install libqt5sql5-mysql
now check your sql drivers folder again:
Code:
ls /usr/lib/arm-linux-gnueabihf/qt5/plugins/sqldrivers
if you have mysql plugin in the folder, you should be good to go
 
Top