MySQLdb - possible without install?

Ken ken_chiba at hotmail.com
Sun Jul 15 01:40:24 CEST 2001


Ok.

Still no luck!  In case I'm just missing something... here is a
listing of various files/directories:

My cgi-bin directory (all executable scripts must be in here to work):

ftp> ls -l
227 Entering Passive Mode (x.x.x.x..x)
150 Opening ASCII mode data connection for file list
drwxr-xr-x   4 a0005722 a0005722      512 Jul 12 17:24 .
drwxr-xr-x  16 a0005722 a0005722      512 May 30 15:02 ..
drwxr-xr-x   3 a0005722 a0005722      512 Jul 14 17:59 MySQLdb
-rwxr-xr-x   1 a0005722 a0005722   264078 Jul 12 17:24 _mysql.so
-rw-r--r--   1 a0005722 a0005722     2288 Jul 12 17:24
_mysql_exceptions.py
-rw-r--r--   1 a0005722 a0005722     4156 Jul 12 17:24
_mysql_exceptions.pyc
-rwxr-xr-x   1 a0005722 a0005722    24265 Mar  9  2000 formmail.cgi
-rwxr-xr-x   1 a0005722 a0005722      149 Jul 12 16:54 test.cgi
226 Transfer complete.

_mysql.so is set to read/execute for all, the other py[c] files are
set to rw/r/r as they are in the site-packages directory locally.

The contents of my test.cgi file are the same as before:

#!/usr/contrib/bin/python
import MySQLdb
print "Content-Type: text/html\n\n"

And the error message is the same as before (in the error_log
logfile):

Traceback (innermost last):
  File "test.cgi", line 4, in ?
    import MySQLdb
  File "MySQLdb/__init__.py", line 27, in ?
    import _mysql
ImportError: File not found
[Sat Jul 14 18:32:57 2001] [error] [client x.x.x.x] Premature end of
script headers: /usr/home/v1/a0005722/html/cgi-bin/test.cgi

Any more ideas?

TIA!

Ken


On Fri, 13 Jul 2001 06:13:50 +0200, gerhard.nospam at bigfoot.de (Gerhard
=?iso-8859-1?Q?H=E4ring?=) wrote:

>On Thu, 12 Jul 2001 22:34:46 GMT, Ken <ken_chiba at hotmail.com> wrote:
>>Thanks for your continued help...  I'm hitting a wall:  I've compiled MySQLdb
>>(on python 1.5.2) -- I believe that's what my ISP's using, and I have the
>>files I (think I) need:
>>
>>_mysql.so
>>_mysql_exceptions.py(c)
>>MySQLdb
>>  - lots of files, and 'constants' within.
>>
>>I've copied these three files, plus the MySQLdb directory to the
>>cgi-bin directory on the host.  I placed a simple python script in the
>>cgi-bin directory that just has:
>>
>>#!/usr/contrib/bin/python  (the python path)
>>import MySQLdb
>>print "Content-Type: text/html\n\n" (so the browser doesn't choke).
>
>Should be ok so far.
>
>>I get a server 500 message, and checking the error_log file, I get:
>>
>>Traceback (innermost last):
>>  File "test.cgi", line 4, in ?
>>    import MySQLdb
>>  File "MySQLdb/__init__.py", line 27, in ?
>>    import _mysql
>>ImportError: File not found
>>[Thu Jul 12 17:25:48 2001] [error] [client 206.47.244.60] Premature
>>end of script headers: /usr/home/v1/a0005722/html/cgi-bin/test.cgi
>
>It looks suspiciously like a problem with file permissions. You should check
>that _mysql.so has read and execute permissions for "others". Taking away both
>I could reproduce the above error message.
>
>In fact, any files in the cgi-bin directory need to be readable by others,
>because the webserver usually does run under a different user and group id.
>
>>I've placed a copy of _mysql.so in both the root cgi-bin directory,
>>and into the MySQLdb directory (since __init__.py is located there).
>>But no luck!  I looked for a _mysql file (without the .so), but could
>>not find one.
>
>That's not the problem. The file is really called _mysql.so and only needs to
>be in the cgi-bin directory.
>
>Gerhard
>-- 
>mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
>web:    http://highqualdev.com              public key at homepage
>public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
>reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))




More information about the Python-list mailing list