August 30, 201312 yr Could someone assist me getting python running nicely with MySQL in unRAID 5.0rc16c. I've already managed to get MySQL running using the unMenu package mysql-5.0.67-i486-1.tgz. It is fully running and I'm able to connect to it from a Win client running MySQL Workbench. I've been following this generic tutorial: http://zetcode.com/db/mysqlpython/ I've downloaded and installed these packages (using installpkg ####.txz): - python-2.6.4-i486-1.txz - MySQL-python-1.2.4-x86_64-1ponce I'm trying to run this really simple connection test: #!/usr/bin/python # -*- coding: utf-8 -*- import sys print "sys.path is", sys.path import MySQLdb as mdb try: con = mdb.connect('localhost', 'terastore', '.terastore.1', 'terastore'); cur = con.cursor() cur.execute("SELECT VERSION()") ver = cur.fetchone() print "Database version : %s " % ver except mdb.Error, e: print "Error %d: %s" % (e.args[0],e.args[1]) sys.exit(1) finally: if con: con.close() But it fails right on the MySQLdb import: root@Tower:/mnt/disk1/test# python test.py sys.path is ['/mnt/disk1/test', '/usr/lib/python26.zip', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/site-packages'] Traceback (most recent call last): File "test.py", line 6, in <module> import MySQLdb as mdb ImportError: No module named MySQLdb I've googled my hear out but found nothing concrete. It must some kind of version conflict and/or install directory thing but just can't find it. Anyone with the knowledge which packages I should be using and how they should be installed? Any help is well appreciated!
Archived
This topic is now archived and is closed to further replies.