Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MySQL and python

Featured Replies

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.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.