Skip to main content
1 of 8

QGIS - access mysql data from python built-in console

I'm writing an QGIS Plugin, and somewhere i want to present data from a MySQL database. It's simple data(strings,etc), not Geospacial, or vector data. I'm used to query databases from python scripts, and now i want to present data inside a TextBrowser QT Widget inside QGIS. I can't import MySQLdb from built-in console, neither from my xxx.py file inside myplugin folder. From Apple Terminal i can import MySQLdb with no problems.

I've read -> Why can't I import my script from the python console?, and still no success, because when i call import MySQLdb inside a script that resides on a folder added to sys.path, it still fails.

Thans for reading!