Trouble with Myqsl

Steve Holden sholden at holdenweb.com
Tue Apr 23 10:08:04 EDT 2002


"Fernando Rodríguez" <frr at easyjob.net> wrote in message
news:uloacus4pml1r7f7eac9ts3u20oroj34qb at 4ax.com...
> On Tue, 23 Apr 2002 08:21:30 -0400, "Steve Holden" <sholden at holdenweb.com>
> wrote:
[incorrect suggestion about string quotes]
>
> If I add the string quotes again, I get the same AttributeError exception
I
> was getting before:
>
> >>> curs.execute("insert into customer_info (email, url, referrer,
first_visit) values ( '%s', '%s', '%s', '%s')", ('billg at microsoft.com',
'www.easyjob.net', 'www.google.com', '2001-03-07 12:32:00'))
> Traceback (most recent call last):
>   File "<pyshell#56>", line 1, in ?
>     curs.execute("insert into customer_info (email, url, referrer,
> first_visit) values ( '%s', '%s', '%s', '%s')", ('billg at microsoft.com',
> 'www.easyjob.net', 'www.google.com', '2001-03-07 12:32:00'))
>   File "D:\ARCHIV~1\Python22\Lib\site-packages\CompatMysqldb.py", line
227, in
> execute
>     af =af+self.__res.affectedrows()
> AttributeError: 'NoneType' object has no attribute 'affectedrows'
> >>>
>
> >It may or may not make a difference. What's the difference between
> >CompatMySQLdb and MySQLdb?
>
> I'm not sure. I haven't been able to find MySQLdb. I found this Compat
thing
> in MySQL-python-0.9.1.win32-py2.2.exe at
>
http://sourceforge.net/project/showfiles.php?group_id=22307&release_id=51760
>
> Where can I find MySQLdb for win32 _and_ Linux? O:-)
>

Sorry I was wrong about the quotes: this apparently only works with the "?"
paramstyle (or possibly it's module-dependent: mxODBC is fine with just
question marks).

I'm confused about why you don't get a proper MySQLdb installation from the
same file I used, though. When I ran it, it installed a MySQLdb directory
ujnder <python>/Lib/site-packages, and I have no problems importing MySQLdb.

In your "Add/Remove programs" control panel item do you see "Python 2.2
MySQL-python-0.9.1"? Maybe a de-install/reinstall would help. My own system
has no reference at all to CompatMySQLdb that I can see, but I notice that
when I open the installer .exe file in WinZip there it is. Did you perchance
treat the installer as an archive rather than running it?

Just in case I'm wrong on this one I'm going to try de-installing and
re-installing the Windows version of the package. It's pretty robust,
though: with Andy Dustman's help I have got it to install from the source
under 2.2 on cygwin as well as under my Windoze installation. It's nice
having MySQLdb and mxODBC under both Windows *and* cygwin.

I'll report back if I discover anything more.

regards
 Steve
--
home: http://www.holdenweb.com/
Python Web Programming:
http://pydish.holdenweb.com/pwp/






More information about the Python-list mailing list