I have written the script as:

import os
import MySQLdb as mdb

os.chroot("/lxc/rootfs")
os.chdir("/")
con = mdb.connect(host="192.168.1.7", user="root", passwd="password")
print "opened"
con.close()

But when I execute, I get the following error:

"File "/usr/lib/python2.7/dist-packages/MySQLdb/__init__.py", line 80, in 
Connect
ImportError: No module named connections"

I have checked there is a connections.py module in the above directory.  Also, 
when I run the script without doing chroot, it works perfectly.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to