Re: MySQLdb for 3.6 on RHEL7

2019-08-13 Thread Inada Naoki
On Wed, Aug 14, 2019 at 4:10 AM Larry Martell wrote: > > > > And I was not able to get that from pip either, > > > as the install failed. I had to download the source, edit the site.cfg > > > file and build it. But I just found python36-mysql.x86_64 as a package > > > so I uninstalled mysqlclient

Re: MySQLdb for 3.6 on RHEL7

2019-08-13 Thread Chris Angelico
On Wed, Aug 14, 2019 at 9:27 AM DL Neil wrote: > > On 14/08/19 6:14 AM, Chris Angelico wrote: > > That seems very odd. The mysqlclient binary might be just under a > > different name? I'm not familiar with RHEL, but on my Debian, there > > are packages like "mysql-server-5.7" and corresponding > >

Re: MySQLdb for 3.6 on RHEL7

2019-08-13 Thread DL Neil
On 14/08/19 6:14 AM, Chris Angelico wrote: On Wed, Aug 14, 2019 at 1:48 AM Larry Martell wrote: On Tue, Aug 13, 2019 at 9:59 AM Chris Angelico wrote: On Tue, Aug 13, 2019 at 11:33 PM Larry Martell wrote: I am trying to install MySQLdb (https://pypi.org/project/mysqlclient/) for python3.6

Re: MySQLdb for 3.6 on RHEL7

2019-08-13 Thread Larry Martell
On Tue, Aug 13, 2019 at 2:16 PM Chris Angelico wrote: > > On Wed, Aug 14, 2019 at 1:48 AM Larry Martell wrote: > > > > On Tue, Aug 13, 2019 at 9:59 AM Chris Angelico wrote: > > > > > > On Tue, Aug 13, 2019 at 11:33 PM Larry Martell > > > wrote: > > > > > > > > I am trying to install MySQLdb (h

Re: MySQLdb for 3.6 on RHEL7

2019-08-13 Thread Chris Angelico
On Wed, Aug 14, 2019 at 1:48 AM Larry Martell wrote: > > On Tue, Aug 13, 2019 at 9:59 AM Chris Angelico wrote: > > > > On Tue, Aug 13, 2019 at 11:33 PM Larry Martell > > wrote: > > > > > > I am trying to install MySQLdb (https://pypi.org/project/mysqlclient/) > > > for python3.6 on RHEL7. > > >

Re: MySQLdb for 3.6 on RHEL7

2019-08-13 Thread Larry Martell
On Tue, Aug 13, 2019 at 9:59 AM Chris Angelico wrote: > > On Tue, Aug 13, 2019 at 11:33 PM Larry Martell > wrote: > > > > I am trying to install MySQLdb (https://pypi.org/project/mysqlclient/) > > for python3.6 on RHEL7. > > > > When I import it, it fails: > > > > # python3.6 > > Python 3.6.8 (d

Re: MySQLdb for 3.6 on RHEL7

2019-08-13 Thread Chris Angelico
On Tue, Aug 13, 2019 at 11:33 PM Larry Martell wrote: > > I am trying to install MySQLdb (https://pypi.org/project/mysqlclient/) > for python3.6 on RHEL7. > > When I import it, it fails: > > # python3.6 > Python 3.6.8 (default, Jun 11 2019, 15:15:01) > [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on li

Re: MySQLdb for 3.6 on RHEL7

2019-08-13 Thread Larry Martell
On Tue, Aug 13, 2019 at 9:43 AM Inada Naoki wrote: > > Why do you use RHEL? That is not my choice. > I believe people use RHEL to get support from Red Hat, instead of community > support. I do not believe Red Hat supports this package. > > 2019年8月13日(火) 22:32 Larry Martell : >> >> I am trying

Re: MySQLdb for 3.6 on RHEL7

2019-08-13 Thread Inada Naoki
Why do you use RHEL? I believe people use RHEL to get support from Red Hat, instead of community support. 2019年8月13日(火) 22:32 Larry Martell : > I am trying to install MySQLdb (https://pypi.org/project/mysqlclient/) > for python3.6 on RHEL7. > > When I import it, it fails: > > # python3.6 > Pytho

Re: MySQLdb and conn.select_db() (Posting On Python-List Prohibited)

2017-11-15 Thread Lawrence D’Oliveiro
On Thursday, November 16, 2017 at 5:32:23 AM UTC+13, Tobiah wrote: > AttributeError: 'Connection' object has no attribute 'select_db' You could always execute a “use «db_name»” MySQL command. -- https://mail.python.org/mailman/listinfo/python-list

Re: MySQLdb Help

2013-09-17 Thread Ervin Hegedüs
Hello, On Tue, Sep 17, 2013 at 07:22:50PM +1000, Ben Finney wrote: > Ervin Hegedüs writes: > > > Hello, > > > > On Tue, Sep 17, 2013 at 05:35:30PM +1000, Ben Finney wrote: > > > for row in cur.fetchall(): > > > > and what if in body of iteration there is another fetchall()? :) > > Yes, what

Re: MySQLdb Help

2013-09-17 Thread Ben Finney
Ervin Hegedüs writes: > Hello, > > On Tue, Sep 17, 2013 at 05:35:30PM +1000, Ben Finney wrote: > > for row in cur.fetchall(): > > and what if in body of iteration there is another fetchall()? :) Yes, what if? Each call to ‘fetchall’ returns a sequence of rows. I don't see your point. -- \

Re: MySQLdb Help

2013-09-17 Thread Ervin Hegedüs
Hello, On Tue, Sep 17, 2013 at 05:35:30PM +1000, Ben Finney wrote: > Venkat Addala writes: > > > rows = cur.fetchall() > > for row in rows: > > You never use ‘rows’ for anything else, so you may as well forget it and > just iterate directly over the return value:: > > for row in cur.fe

Re: MySQLdb Help

2013-09-17 Thread Ervin Hegedüs
Hello, On Tue, Sep 17, 2013 at 12:43:20PM +0530, Venkat Addala wrote: > Hi all, > > > I'm new to python, i am connecting mysql database with python. now i want > to do sanitation on the database, like to remove "\n", extra spaces blah > blah.. and update it back to mysql database. i was trying

Re: MySQLdb Help

2013-09-17 Thread Venkat Addala
hey Ben, Thanks for your solution, i am done with this before, now i'm having problem after deleting \n and extra spaces, i want to update it back it again to mysql db. For this i tried using regular expression check this code; # -*- coding: utf-8 -*- import re import MySQLdb pattern = re.comp

Re: MySQLdb Help

2013-09-17 Thread Ben Finney
Venkat Addala writes: > I'm new to python Welcome! Congratulations on choosing Python for programming. > i am connecting mysql database with python. now i want to do > sanitation on the database, like to remove "\n", extra spaces blah > blah.. and update it back to mysql database. > i was t

Re: MySQLdb Problem

2013-08-31 Thread John Smith
On Sat, 31/8/13, Chris Angelico wrote: Subject: Re: MySQLdb Problem To: python-list@python.org Date: Saturday, 31 August, 2013, 4:18 PM > Do your Python and your MySQLdb match? I haven't confirmed, > but I'm > pretty sure you&

Re: MySQLdb Problem

2013-08-31 Thread Chris Angelico
On Sun, Sep 1, 2013 at 8:17 AM, John Smith wrote: > > > On Sat, 31/8/13, Chris Angelico wrote: > > Subject: Re: MySQLdb Problem > To: python-list@python.org > Date: Saturday, 31 August, 2013, 4:18 PM > >> Do your Py

Re: MySQLdb Problem

2013-08-31 Thread Chris Angelico
On Sat, Aug 31, 2013 at 6:38 PM, John Smith wrote: > Hi; > Since there is no list for MySQLdb, I'm hoping you can help me. I have > installed, de-installed and reinstalled this s/w and MySQL itself on my Win8 > box. However, when I go to use it from a script, I get the following error: > > "C:\P

Re: MySQLdb not playing nice with unicode

2013-03-30 Thread Roy Smith
In article , Roy Smith wrote: > My unicode-fu is a bit weak. Are we looking at a Python problem, a > MySQLdb problem, or a problem with the underlying MySQL server? We've > certainly inserted utf-8 data before without any problems. It's > possible this is the first time we've tried to hand

Re: mySQLdb

2013-02-06 Thread sinaiy
On Saturday, February 2, 2013 12:01:40 PM UTC+2, Armin Karner wrote: > Dear Sir or Madam, > > > > > > > > I am curious if there is an update of MySQLdb for python versions 3.3 or > higher. Because I really need this for a diploma thesis.  > I've tried several of them, including various 2.x

Re: mySQLdb

2013-02-03 Thread Steffen Mutter
Hi Armin, Armin Karner wrote: > I am curious if there is an update of MySQLdb for python versions 3.3 or > higher. Because I really need this for a diploma thesis.  What feature do you need which is not provided? > I really hope you have a solution for me, because it is quite urgent and > imp

Re: mySQLdb

2013-02-02 Thread Stefan Behnel
Michael Torrie, 02.02.2013 19:29: > On 02/02/2013 03:19 AM, Luuk wrote: >> On 02-02-2013 11:01, Armin Karner wrote: >>> MySQLdb for python versions 3.3 or higher >> >> http://lmgtfy.com/?q=MySQLdb+for+python+versions+3.3+or+higher > > Embarrassingly, most of the links on the google search results

Re: mySQLdb

2013-02-02 Thread Michael Torrie
On 02/02/2013 03:19 AM, Luuk wrote: > On 02-02-2013 11:01, Armin Karner wrote: >> MySQLdb for python versions 3.3 or higher > > http://lmgtfy.com/?q=MySQLdb+for+python+versions+3.3+or+higher Embarrassingly, most of the links on the google search results page are about people asking the same quest

Re: mySQLdb

2013-02-02 Thread Luuk
On 02-02-2013 11:01, Armin Karner wrote: MySQLdb for python versions 3.3 or higher http://lmgtfy.com/?q=MySQLdb+for+python+versions+3.3+or+higher -- http://mail.python.org/mailman/listinfo/python-list

Re: MySQLdb compare lower

2012-12-14 Thread Chris Angelico
On Sat, Dec 15, 2012 at 8:49 AM, Dennis Lee Bieber wrote: > On Fri, 14 Dec 2012 15:16:54 +1100, Chris Angelico > declaimed the following in gmane.comp.python.general: > >> Yeah, it's one of the things that tripped me up when I did a >> MySQL->PostgreSQL conversion earlier this year. The code was

Re: MySQLdb compare lower

2012-12-13 Thread Frank Millman
On 14/12/2012 06:16, Chris Angelico wrote: Yeah, it's one of the things that tripped me up when I did a MySQL->PostgreSQL conversion earlier this year. The code was assuming case insensitivity, and began failing on PG. Fortunately the simple change of LIKE to ILIKE solved that. I'd MUCH rather

Re: MySQLdb compare lower

2012-12-13 Thread Chris Angelico
On Fri, Dec 14, 2012 at 2:35 PM, Cameron Simpson wrote: > On 13Dec2012 18:39, Dennis Lee Bieber wrote: > | On Thu, 13 Dec 2012 18:00:48 +1100, Cameron Simpson > | declaimed the following in gmane.comp.python.general: > | > On 12Dec2012 02:03, Dennis Lee Bieber wrote: > | > | According to the

Re: MySQLdb compare lower

2012-12-13 Thread Cameron Simpson
On 13Dec2012 18:39, Dennis Lee Bieber wrote: | On Thu, 13 Dec 2012 18:00:48 +1100, Cameron Simpson | declaimed the following in gmane.comp.python.general: | > On 12Dec2012 02:03, Dennis Lee Bieber wrote: | > | According to the old "MySQL Language Reference" | > | """ | > | By default, string

Re: MySQLdb compare lower

2012-12-12 Thread Cameron Simpson
On 12Dec2012 02:03, Dennis Lee Bieber wrote: | According to the old "MySQL Language Reference" | """ | By default, string comparisons are not case sensitive and will use the | current character set (ISO-8859-1 Latin1 by default, which also works | excellently for English). | """ I'm flabbe

Re: MySQLdb compare lower

2012-12-11 Thread Cameron Simpson
On 11Dec2012 22:01, Anatoli Hristov wrote: | Excuse me for the noob question, but is there a way to compare a field | in mysql as lower() somehow? | | I have a situation where I compare the SKU in my DB and there are some | SKU that are with lowercase and some with uppercase, how can I solve | th

Re: MySQLdb compare lower

2012-12-11 Thread Anatoli Hristov
> I think this will work: > > sql = 'UPDATE product SET price=%s WHERE LOWER(sku)=%s' > cursor.execute(sql, (price, sku.lower()) > Thanks John, this works, I was about to make double check with lower and upper, but this saves me :) Thanks a lot. -- http://mail.python.org/mailman/listinfo/

Re: MySQLdb compare lower

2012-12-11 Thread John Gordon
In Anatoli Hristov writes: > I have a situation where I compare the SKU in my DB and there are some > SKU that are with lowercase and some with uppercase, how can I solve > this in your opinion ? > def Update_SQL(price, sku): > db = MySQLdb.connect("localhost","getit","opencart", > use_un

Re: MySQLdb insert HTML code error

2012-12-11 Thread Anatoli Hristov
> SSCCE starts with "Short". The HTML you unloaded into that email > hardly qualifies. > > When you're trying to figure out a problem that appears to happen only > when you have X and not when you have Y, see what the smallest example > data for X and Y are that continue to exhibit the difference.

Re: MySQLdb insert HTML code error

2012-12-11 Thread Chris Angelico
On Tue, Dec 11, 2012 at 11:46 AM, Anatoli Hristov wrote: >> Brilliant, I think your problem is in line 97 of the code that you *HAVEN'T >> QUOTED*. Please go here, read and inwardly digest before you say anything >> else http://www.sscce.org/ > > :) I thought it was clear. the "spec" is the descr

Re: MySQLdb insert HTML code error

2012-12-10 Thread Anatoli Hristov
> >First thing -- DON'T put quotes around the %s place-holders... The > whole purpose of using the parameterized .execute() is to let the > database adapter properly escape the parameters before putting them into > the SQL (since MySQL didn't have prepared statements before v5, it was > produci

Re: MySQLdb insert HTML code error

2012-12-10 Thread Anatoli Hristov
> You're using a parametrised query (which is good :-)), but you've included > quotes around the placeholders. There's no need to do that. They'll be > quoted automatically when necessary: > > sql = "INSERT INTO product_description (product_id, language_id, name, > description) VALUES (%s,%s,%s,%s)

Re: MySQLdb insert HTML code error

2012-12-10 Thread MRAB
On 2012-12-11 00:04, Anatoli Hristov wrote: Hi all, I'm facing an issue inserting an html code into the DB, it comes out with a syntax error but I face it only when I have html code. Could help me escape the error somehow ? Here is my code def InsertSpecsDB(product_id, spec, lang, name):

Re: MySQLdb insert HTML code error

2012-12-10 Thread Mark Lawrence
On 11/12/2012 00:29, Anatoli Hristov wrote: As much use as a chocolate teapot, all you've given is a function/method definition. No indication of your OS, Python version, calling code, what you expect to happen, what actually happened, apart from that your request for assistance is perfect. Usu

Re: MySQLdb insert HTML code error

2012-12-10 Thread Anatoli Hristov
On Tue, Dec 11, 2012 at 1:29 AM, Anatoli Hristov wrote: >> As much use as a chocolate teapot, all you've given is a function/method >> definition. No indication of your OS, Python version, calling code, what >> you expect to happen, what actually happened, apart from that your request >> for assi

Re: MySQLdb insert HTML code error

2012-12-10 Thread Anatoli Hristov
> As much use as a chocolate teapot, all you've given is a function/method > definition. No indication of your OS, Python version, calling code, what > you expect to happen, what actually happened, apart from that your request > for assistance is perfect. Usually I'd be able to help but sadly my

Re: MySQLdb insert HTML code error

2012-12-10 Thread Mark Lawrence
On 11/12/2012 00:04, Anatoli Hristov wrote: Hi all, I'm facing an issue inserting an html code into the DB, it comes out with a syntax error but I face it only when I have html code. Could help me escape the error somehow ? Here is my code def InsertSpecsDB(product_id, spec, lang, name):

Re: MySQLdb not allowing hyphen

2012-02-08 Thread John Nagle
On 2/5/2012 2:46 PM, Chris Rebert wrote: On Sun, Feb 5, 2012 at 2:41 PM, Emeka wrote: Hello All, I noticed that MySQLdb not allowing hyphen may be way to prevent injection attack. I have something like below: "insert into reviews(message, title)values('%s', '%s')" %( "We don't know where to

Re: MySQLdb not allowing hyphen

2012-02-05 Thread Emeka
Dennis , Chris Thanks so much! On Mon, Feb 6, 2012 at 1:23 AM, Dennis Lee Bieber wrote: > On Mon, 6 Feb 2012 00:41:24 +0200, Emeka wrote: > > >Hello All, > > > >I noticed that MySQLdb not allowing hyphen may be way to prevent injection > >attack. > > What hyphen? > > >I have something

Re: MySQLdb not allowing hyphen

2012-02-05 Thread Chris Rebert
On Sun, Feb 5, 2012 at 2:41 PM, Emeka wrote: > > Hello All, > > I noticed that MySQLdb not allowing hyphen may be way to prevent injection > attack. > I have something like below: > > "insert into reviews(message, title)values('%s', '%s')" %( "We don't know > where to go","We can't wait till morro

Re: MySQLdb Error

2012-01-11 Thread Emeka
Thanks. Regards, Janus On Wed, Jan 11, 2012 at 7:12 PM, Dennis Lee Bieber wrote: > On Wed, 11 Jan 2012 09:57:43 +0200, Emeka wrote: > > > >_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL > >syntax; check the manual that corresponds to your MySQL server version for > >t

Re: MySQLdb Error

2012-01-11 Thread Chris Angelico
On Wed, Jan 11, 2012 at 6:57 PM, Emeka wrote: > CREATE TABLE AddressTables ( AddressTables_id int (9) unsigned > primary key auto_increment not null,  city_name char(40) ,  state_name > varchar,  street_number int,  country_name varchar,  street_name char(40) , > user_name char(40) references user

Re: MySQLdb on Mac Lion

2011-10-13 Thread Tim Johnson
* Ned Deily [111012 18:12]: > In article <20111013005244.gk6...@johnsons-web.com>, > Tim Johnson wrote: > > I'm most experienced with MySQLdb on ubuntu, which is installed via > > apt-get or synaptic. > > > > I am setting up a mac mini with osX 10.7 (Lion). Macports makes > > py27-mysql 1.2.2 a

Re: MySQLdb on Mac Lion

2011-10-12 Thread Ned Deily
In article <20111013005244.gk6...@johnsons-web.com>, Tim Johnson wrote: > I'm most experienced with MySQLdb on ubuntu, which is installed via > apt-get or synaptic. > > I am setting up a mac mini with osX 10.7 (Lion). Macports makes > py27-mysql 1.2.2 available, but are there any .dmg packages >

Re: MySQLdb SEC_TO_TIME function returns datetime.timedelta class

2011-05-15 Thread Jorge Romero
On Sun, May 15, 2011 at 11:50 PM, Chris Angelico wrote: > On Mon, May 16, 2011 at 10:42 AM, Jorge Romero > wrote: > > Hi Pythonists, > > I'm retrieving some time data from a MySQL database using Python's > MySQLdb > > library. Here's the situation, I got a time field on MySQL given in > seconds,

Re: MySQLdb SEC_TO_TIME function returns datetime.timedelta class

2011-05-15 Thread Chris Angelico
On Mon, May 16, 2011 at 10:42 AM, Jorge Romero wrote: > Hi Pythonists, > I'm retrieving some time data from a MySQL database using Python's MySQLdb > library. Here's the situation, I got a time field on MySQL given in seconds, > I need it on HH:MM:SS format, so I'm SELECTING that field with SEC_TO

Re: mysqldb - parameter issue

2010-08-11 Thread bruce
hey dennis... umm.. given that i'm building the ins var/string to insert into the execute... i can't just place the triple quotes around it.. are you saying that the execute should have quotes placed around it within the execute so it would be something like execute("\""+sel""\""... or are you

Re: MySqlDb any way to see the query string

2010-07-10 Thread News123
Hi everybody, im Roberts wrote: > News123 wrote: >> I'm using MYSQLdb >> >> and have following code >> >> db = MySQLdb.connect(**cfg) >> c = db.cursor() >> qrystr = "insert mytable set id = %s , other_field = %s" >> c.execute(qrystr, (id_val,other_field_val) ) >> >> What I wondered is whether t

Re: MySqlDb any way to see the query string

2010-07-10 Thread Tim Roberts
News123 wrote: > >I'm using MYSQLdb > >and have following code > >db = MySQLdb.connect(**cfg) >c = db.cursor() >qrystr = "insert mytable set id = %s , other_field = %s" >c.execute(qrystr, (id_val,other_field_val) ) > >What I wondered is whether there is any way to print the 'filled in' >query str

Re: MySqlDb any way to see the query string

2010-07-10 Thread MRAB
Dennis Lee Bieber wrote: On Sat, 10 Jul 2010 20:22:21 +0200, News123 declaimed the following in gmane.comp.python.general: Hi, I'm using MYSQLdb What I wondered is whether there is any way to print the 'filled in' query string for debuggin. Just edit the MySQLdb cursors m

Re: MySQLdb and bits

2010-06-20 Thread John Nagle
On 6/19/2010 5:24 PM, voidnothings wrote: On Jun 13, 5:52 am, Dafydd Hughes wrote: Hi there This is my first post to the list - please forgive me if this has been addressed elsewhere. I'm running MySQL 32-bit in Snow Leopard, and had MySQLdb working well. I switched to 64-bit, rebuilt MySQLdb

Re: MySQLdb and bits

2010-06-19 Thread voidnothings
On Jun 13, 5:52 am, Dafydd Hughes wrote: > Hi there > > This is my first post to the list - please forgive me if this has been > addressed elsewhere. > > I'm running MySQL 32-bit in Snow Leopard, and had MySQLdb working well. > I switched to 64-bit, rebuilt MySQLdb, and again it worked fine within

Re: MySQLdb problems with named pipe connection on Windows 7?

2010-06-11 Thread John Nagle
I reconfigured MySQL to allow local network connections, and now MySQLdb works over TCP. It doesn't seem to be able to use Windows 7 named pipes, although the "mysql" command line client can. There may be a bug. This wouldn't be noticed unless MySQL was configured without network connections,

Re: MySQLdb problems with named pipe connection on Windows 7?

2010-06-11 Thread John Nagle
On 6/10/2010 11:58 PM, Dennis Lee Bieber wrote: On Thu, 10 Jun 2010 14:15:21 -0700, John Nagle declaimed the following in gmane.comp.python.general: MySQL is configured for connections over named pipes only; it's not running as a TCP server. Is MySQLdb trying to use TCP for a local connection

Re: MySQLDB - server has gone on blob insertion...

2010-06-03 Thread durumdara
Hi! No, there is no same program. I got this ref: http://dev.mysql.com/doc/refman/5.0/en/gone-away.html I will try it. Thanks: dd -- http://mail.python.org/mailman/listinfo/python-list

Re: MySQLDB - server has gone on blob insertion...

2010-06-02 Thread Rami Chowdhury
On Tuesday 01 June 2010 12:46:40 John Nagle wrote: > durumdara wrote: > >>> When I tried to start this, I got error: > >>> _mysql_exceptions.OperationalError: (2006, 'MySQL server has gone > >>> away') > > Are you by any chance trying to do this on a HostGator account? > HostGator servers run

Re: MySQLDB - server has gone on blob insertion...

2010-06-01 Thread John Nagle
durumdara wrote: When I tried to start this, I got error: _mysql_exceptions.OperationalError: (2006, 'MySQL server has gone away') Are you by any chance trying to do this on a HostGator account? HostGator servers run a program which kills long MySQL transactions by executing MySQL "KILL" tra

Re: MySQLDB - server has gone on blob insertion...

2010-06-01 Thread durumdara
Hi! > > drop table blobs > create table blobs (whatever definition it had originally) It was a test. In PGSQL, PYSQLite that was: delete from blobs where (file_id in (select file_id from pics where dir_id=?)) So I need to delete only all blobs that processed. > > > > > When I tried to start th

Re: MySQLdb install vs. "setuptools"

2010-05-30 Thread Benjamin Kaplan
On Sun, May 30, 2010 at 3:16 PM, John Nagle wrote: > Antoine Pitrou wrote: > >> On Sun, 30 May 2010 10:10:00 -0700 >> John Nagle wrote: >> >>> Actually, a "built" but "uninstalled" Python works fine. >>> If it >>> didn't, "make test" wouldn't work. >>> >> >> That's a completely unrelated th

Re: MySQLdb install vs. "setuptools"

2010-05-30 Thread David Cournapeau
On Mon, May 31, 2010 at 7:16 AM, John Nagle wrote: >    It's nice that some of the options work.  Note that someone who > used "--bindir", expecting it to work, might end up overwriting their > existing Python installation unintentionally, which would break system > administration tools like cPan

Re: MySQLdb install vs. "setuptools"

2010-05-30 Thread Antoine Pitrou
On Sun, 30 May 2010 15:16:42 -0700 John Nagle wrote: > > It's nice that some of the options work. Note that someone who > used "--bindir", expecting it to work, might end up overwriting their > existing Python installation unintentionally, which would break system > administration tools lik

Re: MySQLdb install vs. "setuptools"

2010-05-30 Thread John Nagle
Antoine Pitrou wrote: On Sun, 30 May 2010 10:10:00 -0700 John Nagle wrote: Actually, a "built" but "uninstalled" Python works fine. If it didn't, "make test" wouldn't work. That's a completely unrelated thing. The main reason "make test" works with an uninstalled Python is simply so tha

Re: MySQLdb install vs. "setuptools"

2010-05-30 Thread Antoine Pitrou
On Sun, 30 May 2010 10:10:00 -0700 John Nagle wrote: > > Actually, a "built" but "uninstalled" Python works fine. > If it > didn't, "make test" wouldn't work. That's a completely unrelated thing. The main reason "make test" works with an uninstalled Python is simply so that the core develo

Re: MySQLdb install vs. "setuptools"

2010-05-30 Thread John Nagle
John Nagle wrote: David Cournapeau wrote: On Sun, May 30, 2010 at 3:56 PM, John Nagle wrote: MySQLdb won't install as non-root on Python 2.6 because its "setup.py" file requires "setuptools". "setuptools", unlike "distutils", isn't part of the Python 2.6 distribution. IMPORTANT PACKAGES

Re: MySQLdb install vs. "setuptools"

2010-05-30 Thread John Nagle
Antoine Pitrou wrote: Really, this shouldn't happen if you really are using a non-root version of Python: [Errno 2] No such file or directory: '/usr/local/lib/python2.6/site-packages/test-easy-install-22015.write-test' I don't think setuptools is dumb enough to hardcode things like "/usr

Re: MySQLdb install vs. "setuptools"

2010-05-30 Thread John Nagle
David Cournapeau wrote: On Sun, May 30, 2010 at 3:56 PM, John Nagle wrote: MySQLdb won't install as non-root on Python 2.6 because its "setup.py" file requires "setuptools". "setuptools", unlike "distutils", isn't part of the Python 2.6 distribution. IMPORTANT PACKAGES SHOULD NOT USE "set

Re: MySQLdb install vs. "setuptools"

2010-05-30 Thread David Cournapeau
On Sun, May 30, 2010 at 3:56 PM, John Nagle wrote: >   MySQLdb won't install as non-root on Python 2.6 because > its "setup.py" file requires "setuptools".  "setuptools", > unlike "distutils", isn't part of the Python 2.6 distribution. > >   IMPORTANT PACKAGES SHOULD NOT USE "setuptools".  Use the

Re: MySQLdb install vs. "setuptools"

2010-05-30 Thread Antoine Pitrou
Really, this shouldn't happen if you really are using a non-root version of Python: > [Errno 2] No such file or directory: > '/usr/local/lib/python2.6/site-packages/test-easy-install-22015.write-test' I don't think setuptools is dumb enough to hardcode things like "/usr/local/lib/python2.6

Re: MySQLDB - server has gone on blob insertion...

2010-05-27 Thread John Nagle
Dennis Lee Bieber wrote: On Wed, 26 May 2010 11:30:41 +0200, Durumdara declaimed the following in gmane.comp.python.general: cursor.execute('delete from blobs;') Since that statement will delete EVERY record from the table "blobs", I believe it is common practice to replace it with

Re: MySQLdb - weird formatting inconsistency

2010-04-24 Thread Anthra Norell
Anthra Norell wrote: Sebastian Bassi wrote: Hi, Could you post a minimal version of the DB (a DB dump) to test it? Just remove most information and leave on the ones needed to reproduce the error. Also remove any personal/confidential information. Then dump the DB so I can test it here. Best, S

Re: MySQLdb - weird formatting inconsistency

2010-04-24 Thread John Nagle
Anthra Norell wrote: Hi all, Can anyone explain this? Three commands with three different cutoff dates (12/30, 12/31 and 1/1) produce a formatting inconsistency. Examine the third field. The first and last run represents it correctly. The second run strips it. The field happens to be a rec

Re: MySQLdb - weird formatting inconsistency

2010-04-24 Thread Sebastian Bassi
Hi, Could you post a minimal version of the DB (a DB dump) to test it? Just remove most information and leave on the ones needed to reproduce the error. Also remove any personal/confidential information. Then dump the DB so I can test it here. Best, SB. -- http://mail.python.org/mailman/listinfo/

Re: MySQLdb compiled -- Import issue

2010-03-24 Thread Sean DiZazzo
> You are right. I was trying to import the module sitting on the source > folder :"-). Thanks for your quick response and let me try further. Sweet! I remember it because it confused the hell out of me on at least one past occasion. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: MySQLdb compiled -- Import issue

2010-03-24 Thread Kurian Thayil
On Wed, 2010-03-24 at 20:15 -0700, Sean DiZazzo wrote: > On Mar 24, 7:59 pm, Kurian Thayil wrote: > > Hi All, > > > > I am just a month old with Python and trying to learn CGI with Python. I > > was trying to install MySQLdb module in my new CentOS 5.3 box with > > Python 2.4.3 default install.

Re: MySQLdb compiled -- Import issue

2010-03-24 Thread Sean DiZazzo
On Mar 24, 7:59 pm, Kurian Thayil wrote: > Hi All, > > I am just a month old with Python and trying to learn CGI with Python. I > was trying to install MySQLdb module in my new CentOS 5.3 box with > Python 2.4.3 default install. I downloaded the tar-ball of MySQLdb > module (MySQL-python-1.2.3c1).

Re: MySQLdb, blobs, and inserting

2010-02-22 Thread Lawrence D'Oliveiro
In message , Dennis Lee Bieber wrote: > Besides, the approved method of interacting with MySQLdb would use: > > c.execute("insert into items (story) values (%s)", > (file.read(), ) ) > > which lets the adapter properly escape any dangerous characters in the > data, then wrap it with any needed

Re: mysqldb cursor returning type along with result ?

2009-11-29 Thread Lie Ryan
On 11/30/2009 12:14 AM, Paul O'Sullivan wrote: Just taken to Python (2.5)and started to look at some DB cursor stuff using MySQL. Anyway, after creating a query that in MySQL that has a result set of decimals I find that the cursor in python after a fetchall() returns a tuple that contains the f

Re: mysqldb cursor returning type along with result ?

2009-11-29 Thread Tim Chase
((Decimal("101.10"),), (Decimal("99.32"),), (Decimal("97.95"),), (Decimal("98.45"),), (Decimal("97.39"),), (Decimal("97.91"),), (Decimal ("98.08"),), (Decimal("97.73"),)) as such : sum(result) fails with "TypeError: unsupported operand type(s) for +: 'int' and 'tuple'" How do I either get the

Re: MySQLdb

2009-11-22 Thread Kill Joy
On 22 Nov, 16:00, Gerald Walker wrote: > Kill Joy wrote: > > Hi all. > > > I have a mod_python script with two query: > > >    cursor = db.cursor() > > >    sql = 'SELECT * FROM users where username=\'' + username +'\'' > >    cursor.execute(sql) > >    result = cursor.fetchall() > >    num =  int

Re: MySQLdb

2009-11-22 Thread Gerald Walker
Kill Joy wrote: > Hi all. > > I have a mod_python script with two query: > > cursor = db.cursor() > > sql = 'SELECT * FROM users where username=\'' + username +'\'' > cursor.execute(sql) > result = cursor.fetchall() > num = int(cursor.rowcount) > > if num ==

Re: MySQLdb for Python 3.1 getting close?

2009-07-25 Thread John Nagle
(This is actually a repost; outgoing netnews server was down for a while.) John Nagle wrote: Is MySQLdb available for Python 3.1 yet? http://sourceforge.net/projects/mysql-python/ says the last supported Python version is 2.5. Any progress in sight? John Nagle -- http:

Re: MySQLdb + SSH Tunnel

2009-07-14 Thread Riley Crane
Got it working. Thanks for your help! 1) login to B 2) setup a tunnel in the shell machine-B> ssh -L B_ip_address:B_port:C_ip_address:C_port u...@c_ip_address for example: machine-B has ip 1.1.1.1 machine-C has ip 2.2.2.2 then I would type: machine-B> ssh -L 1.1.1.1:3307:2.

Re: MySQLdb + SSH Tunnel

2009-07-14 Thread R C
Got it working. Thanks for your help 1) login to B 2) setup a tunnel in the shell machine-B> ssh -L B_ip_address:B_port:C_ip_address:C_port u...@c_ip_address for example: machine-B has ip 1.1.1.1 machine-C has ip 2.2.2.2 then I would type: machine-B> ssh -L 1.1.1.1:3307:2.2

Re: MySQLdb + SSH Tunnel

2009-07-13 Thread Lawrence D'Oliveiro
In message , Emile van Sebille wrote: > ssh with something like... > > ssh -lroot -L3306:C:3306 B > > Watch out for other instances of mysql on A or B... You can use a non-default local port and specify that in your local connection parameters. Similarly you can tell the remote server to use

Re: MySQLdb + SSH Tunnel

2009-07-12 Thread Emile van Sebille
On 7/12/2009 12:18 PM Riley Crane said... OVERVIEW: I am running a script on one machine that connects to a MySQL database on another machine that is outside of our university's domain. According to the administrator, network policies do not allow the compute nodes to access machines outside of o

Re: MySQLdb and ordering of column names in list returned by keys() w/ a DictCursor

2009-07-02 Thread Petr Messner
2009/7/2 Tim Chase : >> Will this order at least be the same for that same query every time the >> script is executed? > > I wouldn't count on it. The order is only defined for the one iteration > (result of the keys() call). If the order matters, I'd suggest a > double-dispatch with a non-dict (

Re: MySQLdb and ordering of column names in list returned by keys() w/ a DictCursor

2009-07-02 Thread Tim Chase
Will this order at least be the same for that same query every time the script is executed? I wouldn't count on it. The order is only defined for the one iteration (result of the keys() call). If the order matters, I'd suggest a double-dispatch with a non-dict (regular/default) query result

Dict ordering [was: Re: MySQLdb and ordering of column names in list returned by keys() w/ a DictCursor]

2009-07-02 Thread Tim Wintle
On Thu, 2009-07-02 at 10:32 -0500, Wells Oliver wrote: > for row in cursor.fetchall(): > print row.keys() > > What I get is: > > ['league', 'BB', 'HR', 'IP', 'K', 'H', 'player_id', 'ER'] > > Neither alphabetical nor the order in which they were specified in the > query nor... any seeming ord

Re: MySQLdb and ordering of column names in list returned by keys() w/ a DictCursor

2009-07-02 Thread Wells Oliver
Will this order at least be the same for that same query every time the script is executed? On Thu, Jul 2, 2009 at 10:48 AM, Tim Chase wrote: > sql = "SELECT player_id, SUM(K) AS K, SUM(IP) AS IP, SUM(ER) AS ER, SUM(HR) >> AS HR, SUM(H) AS H, SUM(BB) AS BB, Teams.league FROM Pitching INNER JOIN >

Re: MySQLdb and ordering of column names in list returned by keys() w/ a DictCursor

2009-07-02 Thread Tim Chase
sql = "SELECT player_id, SUM(K) AS K, SUM(IP) AS IP, SUM(ER) AS ER, SUM(HR) AS HR, SUM(H) AS H, SUM(BB) AS BB, Teams.league FROM Pitching INNER JOIN Teams ON Pitching.team = Teams.team_id WHERE Date BETWEEN '%s' AND '%s' GROUP BY player_id" % (start, date) cursor.execute(sql) for row in cursor.fe

Re: MySQLdb 1.2.2 + python 2.6.2

2009-05-30 Thread Piet van Oostrum
> monogeo (m) wrote: >m> Hi all, >m> Are MySQLdb 1.2.2 and python 2.6.2 compatible? I went to >m> http://sourceforge.net/project/showfiles.php?group_id=22307, it >m> doesn't say it is compatible or not. >m> When trying to install MySQLdb 1.2.2 on my machine which is running >m> python 2.6.2

Re: MySQLdb and MySQL stored functions

2009-02-04 Thread Nick Craig-Wood
kurt.forrester@googlemail.com wrote: > Any ideas on how to suppress the warning output: > __main__:1: Warning: No data - zero rows fetched, selected, or > processed You can use the warnings module to suppress these I would have thought. -- Nick Craig-Wood -- http://www.craig-wood.com/ni

Re: MySQLdb and MySQL stored functions

2009-02-03 Thread Steve Holden
kurt.forrester@googlemail.com wrote: > On Feb 3, 8:28 am, Dennis Lee Bieber wrote: >> On Mon, 2 Feb 2009 23:28:05 -0800 (PST), >> kurt.forrester@googlemail.com declaimed the following in >> comp.lang.python: >> >>> However, when I try to use the MySQLdb module it returns an incorrect >>> v

Re: MySQLdb and MySQL stored functions

2009-02-03 Thread kurt . forrester . fec
On Feb 3, 8:28 am, Dennis Lee Bieber wrote: > On Mon, 2 Feb 2009 23:28:05 -0800 (PST), > kurt.forrester@googlemail.com declaimed the following in > comp.lang.python: > > > However, when I try to use the MySQLdb module it returns an incorrect > > value (it returns 1). > > > I wish to use the DB

Re: MySQLdb LIKE '%%%s%%' problem

2009-01-14 Thread Steve Holden
John Machin wrote: > On Jan 14, 9:42 pm, Steve Holden wrote: > >> 3. I can't be certain my experience with PostgreSQL extends to MySQl, >> but I have done experiments which prove to my satisfaction that it isn't >> possible to parameterize LIKE arguments. So the only way to do it >> appears to be

  1   2   3   4   >