C
Cyril Bazin
Hi,
I installed an apache server with mod_python.
I have got a problem with the mysql connection of my python script.
In fact I tried this file :
---------------------------------
import os
os.environ["PYTHON_EGG_CACHE"] = "/tmp"
import MySQLdb
from mod_python import apache
def test(req):
db=MySQLdb.connect(user="xxx",passwd="xxx",host="xxx.xxx",db="xxx")
c = db.cursor()
requete = "SELECT * FROM document"
nbRows = c.execute(requete)
req.write("Result : %s"%repr(nbRows))
return apache.OK
---------------------------------
But it seems, after many tests, that the script stops at the
instruction : "c.execute(requete)"
The script works if I am logged on the server as "root" or "www". I use :
---------------------------------
Python 2.4.4 (#1, Oct 23 2006, 13:58:00)
[GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] on linux2
Type "help", "copyright", "credits" or "license" for more information.'3.3.1'
---------------------------------
If someone has any information that can help me...
Thanks in advance,
Cyril BAZIN
I installed an apache server with mod_python.
I have got a problem with the mysql connection of my python script.
In fact I tried this file :
---------------------------------
import os
os.environ["PYTHON_EGG_CACHE"] = "/tmp"
import MySQLdb
from mod_python import apache
def test(req):
db=MySQLdb.connect(user="xxx",passwd="xxx",host="xxx.xxx",db="xxx")
c = db.cursor()
requete = "SELECT * FROM document"
nbRows = c.execute(requete)
req.write("Result : %s"%repr(nbRows))
return apache.OK
---------------------------------
But it seems, after many tests, that the script stops at the
instruction : "c.execute(requete)"
The script works if I am logged on the server as "root" or "www". I use :
---------------------------------
Python 2.4.4 (#1, Oct 23 2006, 13:58:00)
[GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] on linux2
Type "help", "copyright", "credits" or "license" for more information.'3.3.1'
---------------------------------
If someone has any information that can help me...
Thanks in advance,
Cyril BAZIN