I saw a post about this previously… I got MySQL connectivity working in Maya 8.5 with python on Win32.
Here’s how I did it:
- found out that Maya 8.5 uses the python 2.4 interpreter
- downloaded the MySQLdb connector from SourceForge: http://sourceforge.net/project/showfiles.php?group\_id=22307
(make sure you grab the Python 2.4 build, “MySQL-python-1.2.2.win32-py2.4.exe”) - The file you download is a self-extracting archive. I used WinRar to uncompress it to a temporary location
- Copy the uncompressed files to the “\Maya8.5\Python\lib\site-packages” directory
- Start Maya and run some test code via Python:
dbh = MySQLdb.connect(host = “localhost”, user = “root”, passwd = “thePassword”, db = “someDatabase”)
sth = dbh.cursor()
sth.execute (“SELECT NOW()”)
row = sth.fetchone()
print "it is ", row[0]
sth.close()
dbh.close()
For Maya on Win64, you’ll probably have to find a build of MySQLdb for Win64, or compile it yourself. Use gcc on
Cygwin (for example)
…xelA