QMYSQL problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

QMYSQL problem

Angelo
hi

When I create a virtual environment and loaded PyQt5 into it, I realized that I cannot access MySQL database through  QSqlDatabase.addDatabase(self.DBtype), checking I saw that the libsqlmysql.so driver is not present in the sqldrivers directory along with the others. I tried to search the internet for the file in question, and nothing on the qt.io website, and also on mysql.com I can't find the file. if i use the one installed in my ubuntu 20.10 distribution it tells me that it is not compatible with the others. In a standard environment its does. Anyone have a solution to suggest?

Angelo
Reply | Threaded
Open this post in threaded view
|

Re: QMYSQL problem

J Barchan

On Sun, 25 Oct 2020 at 14:49, Angelo Ballabio <[hidden email]> wrote:
hi

When I create a virtual environment and loaded PyQt5 into it, I realized that I cannot access MySQL database through  QSqlDatabase.addDatabase(self.DBtype), checking I saw that the libsqlmysql.so driver is not present in the sqldrivers directory along with the others. I tried to search the internet for the file in question, and nothing on the qt.io website, and also on mysql.com I can't find the file. if i use the one installed in my ubuntu 20.10 distribution it tells me that it is not compatible with the others. In a standard environment its does. Anyone have a solution to suggest?

Angelo

My understanding: as of the changes made in Oracle licensing, Qt can no longer distribute MySQL driver ready-built.  You have to build it for yourself now.

In the release distro of Ubuntu 20.04 there is a ready-built SQL driver.  If you use that then no need to build.

But if you take a later Qt you have to do the build.  I don't know exactly how this relates to your version of PyQt5 or your virtual environment though.  But I'm assuming there is a relationship?

Hope this helps, I am interested to see the correct answer.