Code: Alles auswählen
#!/usr/bin/python
import cgi
import _mysql
print "Content-type: text/html"
print
db=_mysql.connect(host="localhost", user="XXXX", passwd="XXXX", db="XXXX")
Weiß jemand warum?
MfG
Andreas
Code: Alles auswählen
#!/usr/bin/python
import cgi
import _mysql
print "Content-type: text/html"
print
db=_mysql.connect(host="localhost", user="XXXX", passwd="XXXX", db="XXXX")
Code: Alles auswählen
print "hallo"
Code: Alles auswählen
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import sys, os
import cgitb; cgitb.enable()
import MySQLdb
print "Content-Type: text/html; charset=utf-8\n"
print "<h1>Hello MySQLdb</h1>"
conn = MySQLdb.connect(host='localhost', user='xxxxxxx', passwd='xxxxxx', db='xxxxxxx')
cursor = conn.cursor ()
cursor.execute ("SELECT VERSION()")
row = cursor.fetchone ()
print "server version:", row[0]
cursor.close ()
conn.close ()
So wie ich das sehe, scheint das ein Problem von MySQLdb zu sein.andreaszdw hat geschrieben:Was ist da los?
Der Fehler kommt nur bei Skripten mit MySQLdb, andere Skripte laufen.
Code: Alles auswählen
print MySQLdb.version_info
Code: Alles auswählen
print MySQLdb.version_info