On 13/04/2006, at 5:26 AM, Firat KUCUK wrote:

Hi,
i wrote a simple connection script.
It works as a command line script or cgi script.
But does not work in mod_python.

import MySQLdb
conn = MySQLdb.connect(
          host   = '127.0.0.1',
          user   = 'pismikrop',
          passwd = 'pass',
          db     = 'db')
print conn
conn.close()

command-line and cgi output:
<_mysql.connection open to '127.0.0.1' at 81a304c>

mod_python output:
<_mysql.connection open to '(null)' at 82ac504>

i cannot execute MySQL queries. What should i do?

Can you supply the remainder of your mod_python handler code
so we can see the context in which this used? Minimal but complete
as possible is preferable.

If the above is truly exactly how you are using it, you probably aren't
using mod_python but a CGI scripts as "print" statement will not
output anywhere in mod_python so you wouldn't be able to capture
it.

Graham

Reply via email to