Accessing a MySQL database - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27) +--- Thread: Accessing a MySQL database (/showthread.php?tid=56975) |
Accessing a MySQL database - bmillham - 2009-08-27 Hi all, I'm new here, and new to XBMC. I'm running XBMC on my Ubuntu laptop. (I'm experimenting with moving from Windows to Ubuntu) On my Windows system, I use Movie Collectorz to store all my movie info. There is a way to export the Collectorz database to a MySQL database. What I'd like to do is to write a script for XBMC to display a list of the movies in the MySQL database, and play that movie. I found a nice tutorial that has a simple Python script working with XBMC. However, when I add the 'include MySQLdb' line to the python script, it fails with 'No module named MySQLdb' I've installed the Python MySQL module in Ubuntu, and it works from a commandline python script. How can I get XBMC to recognize that I have the module, or is there a seperate module for XBMC? Thanks! Brian - blittan - 2009-08-27 you need to supply the module in the same folder as your script. - bmillham - 2009-08-28 Thanks, that got me closer. I had to copy the MySQLdb directory, and _mysql.so. Now when I run the script, xbmc closes with no errors. Heres whats in xbmc.log: Code: 17:59:58 T:878417984 M:1269411840 DEBUG: Load list-focus.png: 0.2ms (bundled) - bmillham - 2009-08-28 I found the problem. The _mysql.so version for 64bit Jaunty does not work properly with XBMC. I got the _mysql.so from Intrepid (for python 2.4) and that works fine with XBMC. If anyone else runs into this, heres where to get the proper _mysql.so http://packages.ubuntu.com/intrepid/python-mysqldb Thanks for the help, and I'll probably be back with more questions! Brian |