I'm having some trouble with MySQLdb when using it in a CGI script. I'm on OSx and running off a local host.
Basically, when I run my code from the terminal it runs fine, but when I run it from a browser, it executes everything up until the import MySQLdb line, and nothing after.
For example:
#!/usr/bin/python
print "Content-Type: text/html\n"
print "abc"
In the browser and the terminal, this prints out abc.
But the following:
#!/usr/bin/python
print "Content-Type: text/html\n"
print "abc"
import MySQLdb
print "123"
In the terminal prints out abc and 123, but in the browser it just prints out abc.
It seems that it's having a problem with the import MySQLdb line, but I can't see any errors.
Would anyone have any ideas?