Re: [sqlalchemy] MySQL Connector

2019-03-09 Thread Mike Bayer
Note the mysql-connector people actually contacted us this week on the
devel list, and while mysql-connector-python does still have a lot of
major issues they are not as bad as the ones I listed on the site, as
apparently there is a totally different fork of it called
mysql-connector also on pypi that is ancient so most of the problems
were there.Current 8.x release still has binary data issues and
possibly some lockup issues though.

On Tue, Mar 5, 2019 at 7:08 PM Warwick Prince  wrote:
>
> Hi Mike
>
> Thanks very much.  It’s a shame they broke it so badly!  I’ll change to your 
> recommendation immediately.
>
> Cheers
> Warwick
>
> Warwick A. Prince
> Mushroom Systems International Pty. Ltd.
>
> > On 5 Mar 2019, at 3:07 am, Mike Bayer  wrote:
> >
> >> On Sun, Mar 3, 2019 at 8:40 PM Warwick Prince  
> >> wrote:
> >>
> >> Hi Community
> >>
> >> We’ve been using sqlalchemy with great success for many years.  We’ve been 
> >> using the mysqlconnector to connect to my MySQL databases with no issues 
> >> to speak of.
> >>
> >> My issue is that I recently upgraded to the latest version of the 
> >> connector from Oracle which has changed from Python to C.  I’m now 
> >> regularly receiving the following error where this has never happened in 
> >> the past;   MySQL 5.6 BTW.
> >>
> >> DatabaseError: (mysql.connector.errors.HashError) Hashed authentication 
> >> data is invalid
> >>
> >> Obviously, I would assume that this is not a sqlalchemy issue, however 
> >> there’s nothing really being spoken about this anywhere else and I 
> >> wondered if anyone had had the problem and fixed it - or eventually rolled 
> >> back to the very old version of mysqlconnector?
> >
> > Unfortunately recent versions of MySQL connector, specifically when
> > the C code was added, work very poorly, such that I had to remove
> > mysql connector from testing.   I documented a partial list of
> > blocking issues I encountered here:
> > https://docs.sqlalchemy.org/en/latest/dialects/mysql.html#current-issues
> >
> >
> >>
> >> Alternatively, @Mike - could you recommend in your opinion the ‘best’ 
> >> connector to use for MySQL based on reliability and performance.
> >
> > The best drivers for MySQL are mysqlclient and pymysql, both
> > maintained by the same person.  Both drivers work very well and are
> > well supported.   mysqlclient is a fork of the original C based
> > python-mysql driver which is no longer maintained.
> >
> >
> >>
> >> Cheers
> >> Warwick
> >>
> >> Warwick Prince
> >> Managing Director
> >> mobile: +61 411 026 992
> >> skype: warwickprince
> >> phone: +61 7 3102 3730
> >> fax:  +61 7 3319 6734
> >> web: www.mushroomsys.com
> >>
> >> --
> >> SQLAlchemy -
> >> The Python SQL Toolkit and Object Relational Mapper
> >>
> >> http://www.sqlalchemy.org/
> >>
> >> To post example code, please provide an MCVE: Minimal, Complete, and 
> >> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> >> description.
> >> ---
> >> You received this message because you are subscribed to the Google Groups 
> >> "sqlalchemy" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an 
> >> email to sqlalchemy+unsubscr...@googlegroups.com.
> >> To post to this group, send email to sqlalchemy@googlegroups.com.
> >> Visit this group at https://groups.google.com/group/sqlalchemy.
> >> For more options, visit https://groups.google.com/d/optout.
> >
> > --
> > SQLAlchemy -
> > The Python SQL Toolkit and Object Relational Mapper
> >
> > http://www.sqlalchemy.org/
> >
> > To post example code, please provide an MCVE: Minimal, Complete, and 
> > Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full 
> > description.
> > ---
> > You received this message because you are subscribed to the Google Groups 
> > "sqlalchemy" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to sqlalchemy+unsubscr...@googlegroups.com.
> > To post to this group, send email to sqlalchemy@googlegroups.com.
> > Visit this group at https://groups.google.com/group/sqlalchemy.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full 
> description.
> ---
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please 

Re: [sqlalchemy] MySQL Connector

2019-03-05 Thread Warwick Prince
Hi Mike

Thanks very much.  It’s a shame they broke it so badly!  I’ll change to your 
recommendation immediately.

Cheers
Warwick 

Warwick A. Prince
Mushroom Systems International Pty. Ltd.

> On 5 Mar 2019, at 3:07 am, Mike Bayer  wrote:
> 
>> On Sun, Mar 3, 2019 at 8:40 PM Warwick Prince  
>> wrote:
>> 
>> Hi Community
>> 
>> We’ve been using sqlalchemy with great success for many years.  We’ve been 
>> using the mysqlconnector to connect to my MySQL databases with no issues to 
>> speak of.
>> 
>> My issue is that I recently upgraded to the latest version of the connector 
>> from Oracle which has changed from Python to C.  I’m now regularly receiving 
>> the following error where this has never happened in the past;   MySQL 5.6 
>> BTW.
>> 
>> DatabaseError: (mysql.connector.errors.HashError) Hashed authentication data 
>> is invalid
>> 
>> Obviously, I would assume that this is not a sqlalchemy issue, however 
>> there’s nothing really being spoken about this anywhere else and I wondered 
>> if anyone had had the problem and fixed it - or eventually rolled back to 
>> the very old version of mysqlconnector?
> 
> Unfortunately recent versions of MySQL connector, specifically when
> the C code was added, work very poorly, such that I had to remove
> mysql connector from testing.   I documented a partial list of
> blocking issues I encountered here:
> https://docs.sqlalchemy.org/en/latest/dialects/mysql.html#current-issues
> 
> 
>> 
>> Alternatively, @Mike - could you recommend in your opinion the ‘best’ 
>> connector to use for MySQL based on reliability and performance.
> 
> The best drivers for MySQL are mysqlclient and pymysql, both
> maintained by the same person.  Both drivers work very well and are
> well supported.   mysqlclient is a fork of the original C based
> python-mysql driver which is no longer maintained.
> 
> 
>> 
>> Cheers
>> Warwick
>> 
>> Warwick Prince
>> Managing Director
>> mobile: +61 411 026 992
>> skype: warwickprince
>> phone: +61 7 3102 3730
>> fax:  +61 7 3319 6734
>> web: www.mushroomsys.com
>> 
>> --
>> SQLAlchemy -
>> The Python SQL Toolkit and Object Relational Mapper
>> 
>> http://www.sqlalchemy.org/
>> 
>> To post example code, please provide an MCVE: Minimal, Complete, and 
>> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
>> description.
>> ---
>> You received this message because you are subscribed to the Google Groups 
>> "sqlalchemy" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sqlalchemy+unsubscr...@googlegroups.com.
>> To post to this group, send email to sqlalchemy@googlegroups.com.
>> Visit this group at https://groups.google.com/group/sqlalchemy.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> SQLAlchemy - 
> The Python SQL Toolkit and Object Relational Mapper
> 
> http://www.sqlalchemy.org/
> 
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full 
> description.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] MySQL Connector

2019-03-04 Thread Mike Bayer
On Sun, Mar 3, 2019 at 8:40 PM Warwick Prince  wrote:
>
> Hi Community
>
> We’ve been using sqlalchemy with great success for many years.  We’ve been 
> using the mysqlconnector to connect to my MySQL databases with no issues to 
> speak of.
>
> My issue is that I recently upgraded to the latest version of the connector 
> from Oracle which has changed from Python to C.  I’m now regularly receiving 
> the following error where this has never happened in the past;   MySQL 5.6 
> BTW.
>
> DatabaseError: (mysql.connector.errors.HashError) Hashed authentication data 
> is invalid
>
> Obviously, I would assume that this is not a sqlalchemy issue, however 
> there’s nothing really being spoken about this anywhere else and I wondered 
> if anyone had had the problem and fixed it - or eventually rolled back to the 
> very old version of mysqlconnector?

Unfortunately recent versions of MySQL connector, specifically when
the C code was added, work very poorly, such that I had to remove
mysql connector from testing.   I documented a partial list of
blocking issues I encountered here:
https://docs.sqlalchemy.org/en/latest/dialects/mysql.html#current-issues


>
> Alternatively, @Mike - could you recommend in your opinion the ‘best’ 
> connector to use for MySQL based on reliability and performance.

The best drivers for MySQL are mysqlclient and pymysql, both
maintained by the same person.  Both drivers work very well and are
well supported.   mysqlclient is a fork of the original C based
python-mysql driver which is no longer maintained.


>
> Cheers
> Warwick
>
> Warwick Prince
> Managing Director
> mobile: +61 411 026 992
> skype: warwickprince
> phone: +61 7 3102 3730
> fax:  +61 7 3319 6734
> web: www.mushroomsys.com
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
> ---
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


[sqlalchemy] MySQL Connector

2019-03-03 Thread Warwick Prince
Hi Community

We’ve been using sqlalchemy with great success for many years.  We’ve been 
using the mysqlconnector to connect to my MySQL databases with no issues to 
speak of.

My issue is that I recently upgraded to the latest version of the connector 
from Oracle which has changed from Python to C.  I’m now regularly receiving 
the following error where this has never happened in the past;   MySQL 5.6 BTW.

DatabaseError: (mysql.connector.errors.HashError) Hashed authentication data is 
invalid

Obviously, I would assume that this is not a sqlalchemy issue, however there’s 
nothing really being spoken about this anywhere else and I wondered if anyone 
had had the problem and fixed it - or eventually rolled back to the very old 
version of mysqlconnector?

Alternatively, @Mike - could you recommend in your opinion the ‘best’ connector 
to use for MySQL based on reliability and performance.

Cheers
Warwick

Warwick Prince 
Managing Director 
mobile: +61 411 026 992
skype: warwickprince   
phone: +61 7 3102 3730 
fax:  +61 7 3319 6734 
web: www.mushroomsys.com 

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


[sqlalchemy] MySQL Connector and BIT test case (+patch)

2010-01-15 Thread geertjanvdk
Hello,

We had a problem with BIT data types in MySQL Connector/Python. A fix
was pushed today, but I can't still make this test_bit_50 (here below)
work.
It appears that what gets back from MySQL through RowProxy(?) is
'empty'. If anyone can hit me with the cluebat to figure out what's
wrong?

Also added here below is a patch for the test case and the
mysqlconnector dialect.

I still have 6 Errors when running the MySQL dialect tests (first
fixing these). Pretty good stuff!

-Geert

==
ERROR: test.dialect.test_mysql.TypesTest.test_bit_50
--
Traceback (most recent call last):
  File /Library/Python/2.6/site-packages/nose-0.11.1-py2.6.egg/nose/
case.py, line 183, in runTest
self.test(*self.arg)
  File /Users/geert/Projects/sqlalchemy-trunk/lib/sqlalchemy/test/
testing.py, line 236, in maybe
return fn(*args, **kw)
  File /Users/geert/Projects/sqlalchemy-trunk/test/dialect/
test_mysql.py, line 338, in test_bit_50
roundtrip([0] * 8)
  File /Users/geert/Projects/sqlalchemy-trunk/test/dialect/
test_mysql.py, line 334, in roundtrip
print Found %s % list(row)
  File /Users/geert/Projects/sqlalchemy-trunk/lib/sqlalchemy/engine/
base.py, line 1575, in __iter__
yield func(row)
  File /Users/geert/Projects/sqlalchemy-trunk/lib/sqlalchemy/engine/
base.py, line 1825, in getcol
return processor(row[index])
  File /Users/geert/Projects/sqlalchemy-trunk/lib/sqlalchemy/dialects/
mysql/base.py, line 561, in process
for i in map(ord, value):
TypeError: argument 2 to map() must support iteration
  begin captured stdout  -
Storing [0, 0, 0, 0, 0, 0, 0, 0]
Expected [0, 0, 0, 0, 0, 0, 0, 0]




Index: test/dialect/test_mysql.py
===
--- test/dialect/test_mysql.py  (revision 6622)
+++ test/dialect/test_mysql.py  (working copy)
@@ -1199,11 +1199,22 @@
 def teardown_class(cls):
 metadata.drop_all()

+@testing.fails_on('mysql+mysqlconnector', 'uses pyformat')
 def test_expression(self):
 format = testing.db.dialect.paramstyle == 'format' and '%s'
or '?'
 self.assert_compile(
 matchtable.c.title.match('somstr'),
 MATCH (matchtable.title) AGAINST (%s IN BOOLEAN MODE) %
format)
+
+@testing.fails_on('mysql+mysqldb', 'uses format')
+@testing.fails_on('mysql+oursql', 'uses format')
+@testing.fails_on('mysql+pyodbc', 'uses format')
+@testing.fails_on('mysql+zxjdbc', 'uses format')
+def test_expression(self):
+format = '%(title_1)s'
+self.assert_compile(
+matchtable.c.title.match('somstr'),
+MATCH (matchtable.title) AGAINST (%s IN BOOLEAN MODE) %
format)

 def test_simple_match(self):
 results = (matchtable.select().
Index: lib/sqlalchemy/dialects/mysql/mysqlconnector.py
===
--- lib/sqlalchemy/dialects/mysql/mysqlconnector.py (revision 6622)
+++ lib/sqlalchemy/dialects/mysql/mysqlconnector.py (working copy)
@@ -66,11 +66,15 @@
 return connection.connection.get_characterset_info()

 def _extract_error_code(self, exception):
-m = re.compile(r\(.*\)\s+(\d+)).search(str(exception))
-c = m.group(1)
-if c:
-return int(c)
-else:
+try:
+return exception.orig.errno
+except AttributeError:
 return None
+
+def _compat_fetchall(self, rp, charset=None):
+return rp.fetchall()

+def _compat_fetchone(self, rp, charset=None):
+return rp.fetchone()
+
 dialect = MySQL_mysqlconnector

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.




[sqlalchemy] MySQL Connector/Python support

2010-01-04 Thread geertjanvdk
Hello,

And best wishes for 2010! I am the maintainer, Geert Vanderkelen, of
MySQL Connector/Python at Sun Microsystems.

First, thanks for taking MySQL Connector/Python and putting it in as a
dialect in SQL Alchemy, great stuff already! This will be great for
other projects using SQLAlchemy. Very cool!

Few things:
* Could you change the dialect name from 'myconnpy' to
'mysqlconnector' or something like that. 'MySQL' should be first in
the name, as this is most 'official' thing the MySQL Team has done for
Python. Would be great. 'myconnpy' is just the short tag on LaunchPad.
* Checking the current trunk of SQLAlchemy, it's using a quite old
version of MySQL Connector/Python. We've done some development
releases lately, and there will be more. The bug mentioned, was fixed
though!

Maybe, if I'll find time, I'll check the code myself and do some work
there too.

I'm looking forward for ideas, and improvements for MySQL Connector/
Python to make the integration easier. If you guys have ideas, please
post them on LaunchPad.

Cheers,

Geert

--

You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.