trouble installing MySQLdb (cygwin) + Bonus question

Nitin Pawar nitinpawar432 at gmail.com
Tue Jan 25 10:16:48 EST 2011


Nothing againest mysqlDB but I had tried using it sometimes and found it
little difficult to use when you left the connections open idle for sometime
.

I had used PySQLPool then to solve my issues.

Give it a try, I would recommend it.

Thanks,
nitin

On Tue, Jan 25, 2011 at 8:35 PM, Matthew Roth <mgroth86 at gmail.com> wrote:

> On Jan 25, 4:30 am, Dennis Lee Bieber <wlfr... at ix.netcom.com> wrote:
> > On Mon, 24 Jan 2011 14:25:09 -0800 (PST), Matthew Roth
> > <mgrot... at gmail.com> declaimed the following in
> > gmane.comp.python.general:
> >
> >
> >
> > > I've explored various avenues all day to no avail. Can anyone offer a
> > > solution or a direction to work towards. One avenue was ignorning the
> > > check for posix, and having it run setup_windows, but this just brings
> > > in problems with _winreg(?) seeing how I have a posix version of
> > > python through cygwin.
> >
> >         Maybe you need the development headers for MySQL?
> --
> I do believe I have them. Perhaps I need to find the correct way to
> point to them.
> I believe it is looking for the dev headers for a linux client when I
> am using a client for windows via cygwin.
>
> Or perhaps I should look into installing a separate linux mysql client
> in cygwin.
> I read of a similiar problem with perl, but the documentation felt a
> bit dated and several steps would no longer function correctly.
>
> >
> > > Lastly, for the bonus question.
> > > Why MySQLdb why not something like this:
> > > --
> > > import os
> > > cmd = 'mysql -uroot -pxxx db -e "SELECT * FROM tblxxx;"'
> > > os.system(cmd)
> >
> >         Passing username/password to a shell command that might be parsed
> by
> > some outside process? Security leak!
> --
> I do indeed see that. However, all my python calls will be done within
> my local intranet.
> But is this a reason to not use os module at all? fetching a
> dirlisting or mkdir is still
> a valid reason to use the os Module, correct?
> >
> >         Second -- MySQL is a server model DBMS; it doesn't have to be on
> the
> > local machine.
> --
> unfortunately, for my use it does. We do have an old centOs box here,
> but the mysql running on that is severely outdated and so too is the
> python.
> I have been discouraged from upgrading the former, and the latter I
> was told only if I could do it through yum. Making an altinstall form
> source seems to be
> discouraged. Good news is I think they have decided to upgrade our
> development box.
> >
> >         Third -- ever heard of TRANSACTIONS? How would you handle a
> > transaction if every SQL statement was a totally independent process?
> > --
> No. quite to my embarrassment I haven't. But this is not to say I have
> not used them. It sounds as if I have.
> But, you can put more than one sql statement into a cmdline.
> mysql = "mysql -uuser -ppass db -e \"SELECT CURTIME();
>           CREATE TABLE tempTBL (
>           freq INT,
>           x INT,
>           y VARCHAR(255),
>           PRIMARY KEY(x, y);
>
>           LOAD XML INFLE 'doc'
>           INTO TABLE tempTBL
>           ROWS IDENTIFIED BY '<line>';
>
>           INSERT INTO freqTbl(x,y,freq)
>           SELECT x,y,freq FROM tempTBL
>           ON DUPLICATE KEY UPDATE freq=tempTbl.freq+freqTbl.freq;
>
>           SELECT CURTIME();\"
> os.system(mysql)
>
> I haven't tested that, but I know it works at the command line.
> I do fully intend to use MySQLdb through python and conduct more of
> the processing and parsing in python. It will be a learning
> experience. I have a background in anthropology, not computer science.
> But I love learning all this, and love that my place of employment
> encourages me to learn this. Unfortunately with self-learning you can
> sometimes miss out on important concepts and still accomplish tasks.
>
> Thank you for your reply.
>
>
> >         Wulfraed                 Dennis Lee Bieber         AF6VN
> >         wlfr... at ix.netcom.com    HTTP://wlfraed.home.netcom.com/
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Nitin Pawar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110125/1985af31/attachment.html>


More information about the Python-list mailing list