Re: django and mysql versions

32 views
Skip to first unread message
Message has been deleted

Elizabeth Rachel Lemon

unread,
Sep 30, 2012, 4:14:08 PM9/30/12
to django...@googlegroups.com, wlf...@ix.netcom.com
Thanks for the response -- this is really useful information about what MySQL features new to version 5.5 are not handled by MySQLdb. 

In this case, my reasons for asking about using MySQL 5.5 aren't really about wanting any features that are available only in 5.5, but more about a situation where the choice of MySQL version isn't entirely up to me.  I'm hoping to avoid spending time configuring a development environment with this version only to find out that this actually doesn't work at all.  So from your response I get that probably it would work. 

Is there anyone out there who's actually tried it and knows from experience what will happen?  If not, I'll try it and update this thread with how it comes out. 



On Sunday, September 30, 2012 1:38:45 PM UTC-4, Dennis Lee Bieber wrote:
On Sun, 30 Sep 2012 09:18:49 -0700 (PDT), Elizabeth Rachel Lemon
<ele...@gmail.com> declaimed the following in
gmane.comp.python.django.user:

> Is anyone using Django with MySQL 5.5? The page that says "5.0.3 and
> higher" seems to me to imply that this would work, but if MySQLdb is
> required for Django and MySQLdb only supports up to 5.1, then that implies
> that it is at least not supported. Anyone tried it?

        The main features that have been added to MySQL are views, triggers,
stored procedures... And "prepared statements".

        So far as I know, the only thing MySQLdb doesn't handle is the
"prepared statements" aspect -- it uses the query interface that is
common to all versions: it sends complete text queries. The main place
where the difference would be visible is if one does an .executemany().

        The common-to-all versions would issue multiple complete statements,
which need to be parsed and compiled by MySQL /each time/:

insert into thetable (f1, f2, f3) values (v11, v12, v13)
insert into thetable (f1, f2, f3) values (v21, v22, v23)
insert into thetable (f1, f2, f3) values (v31, v32, v33)

        Prepared statements would send a parameterized statement to MySQL to
be "compiled"

insert into thetable (f1, f2, f3) values (?1, ?2, ?3)

and then send the values separately, telling MySQL to use the already
compiled statement

stmtref, v11, v12, v13
stmtref, v21, v22, v23
stmtref, v31, v32, v33

        I'd find it highly unlikely that MySQL would have /removed/ some
portion of the API that would invalidate pre-existing application code.

--
        Wulfraed                 Dennis Lee Bieber         AF6VN
        wlf...@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

Message has been deleted

Javier Guerra Giraldez

unread,
Oct 1, 2012, 12:03:15 AM10/1/12
to django...@googlegroups.com
On Sun, Sep 30, 2012 at 12:38 PM, Dennis Lee Bieber
<wlf...@ix.netcom.com> wrote:
> The main features that have been added to MySQL are views, triggers,
> stored procedures... And "prepared statements".

I beg to differ:

http://dev.mysql.com/doc/refman/5.0/en/create-view.html
http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html
http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html
http://dev.mysql.com/doc/refman/5.0/en/sql-syntax-prepared-statements.html

all these features were already implemented in MySQL 5.0

As far as I can tell, none of these is used by MySQLdb, so it doesn't
make any difference. It would certainly be odd if it worked with 5.1
and not with 5.5

Note that recent Ubuntu distros install MySQL 5.5 by default. I guess
that if there was any problem with that, we would be innundated by bug
reports.

--
Javier

Tom Evans

unread,
Oct 1, 2012, 7:04:44 AM10/1/12
to django...@googlegroups.com
On Sun, Sep 30, 2012 at 5:18 PM, Elizabeth Rachel Lemon
<ele...@gmail.com> wrote:
> According to this page:
> https://docs.djangoproject.com/en/dev/ref/databases/
> "Django supports MySQL 5.0.3 and higher."
>
> But the next section says that MySQLdb is required, and when you click the
> link to MySQLdb from that page, it goes to this page:
> http://sourceforge.net/projects/mysql-python/
>
> which states that the supported versions are:
> "MySQL versions from 3.23 to 5.1"
>
> Is anyone using Django with MySQL 5.5? The page that says "5.0.3 and higher"
> seems to me to imply that this would work, but if MySQLdb is required for
> Django and MySQLdb only supports up to 5.1, then that implies that it is at
> least not supported. Anyone tried it?
>

5.5 will work completely fine.

5.1 was Sun's 'new features' branch, which was to be the way
everything was going to go, but after Oracle bought Sun and
re-purposed their engineering so that it wasn't quite so gung-ho, it
was clear 5.1 was a dead end. 5.5 is Oracle's reboot of that, and is
closer to 5.0 than 5.1.

Most of these new features in both branches are orthogonal to working
with Django's ORM however, as the client API has remained completely
stable, with only new features being added.

Cheers

Tom
Reply all
Reply to author
Forward
0 new messages