django seems does not support mysql 5.7.9

1,520 views
Skip to first unread message

Pengfei Xue

unread,
Nov 17, 2015, 7:02:56 AM11/17/15
to Django users
yesterday, i upgraded my local mysql server to 5.7.9 (mysql  Ver 14.14 Distrib 5.7.9, for osx10.11 (x86_64) using  EditLine wrapper), and
found i can not make my app run anymore, find this error, is there some one else get this error before?

MySQL-python==1.2.5
Django==1.8.6

  File "/Users/pengfei/Code/gengmei/.gaia/lib/python2.7/site-packages/django/db/backends/base/base.py", line 462, in temporary_connection
    cursor = self.cursor()
  File "/Users/pengfei/Code/gengmei/.gaia/lib/python2.7/site-packages/django/db/backends/base/base.py", line 162, in cursor
    cursor = self.make_debug_cursor(self._cursor())
  File "/Users/pengfei/Code/gengmei/.gaia/lib/python2.7/site-packages/django/db/backends/base/base.py", line 135, in _cursor
    self.ensure_connection()
  File "/Users/pengfei/Code/gengmei/.gaia/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
    self.connect()
  File "/Users/pengfei/Code/gengmei/.gaia/lib/python2.7/site-packages/django/db/backends/base/base.py", line 119, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/Users/pengfei/Code/gengmei/.gaia/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 276, in get_new_connection
    conn = Database.connect(**conn_params)
  File "/Users/pengfei/Code/gengmei/.gaia/lib/python2.7/site-packages/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/Users/pengfei/Code/gengmei/.gaia/lib/python2.7/site-packages/MySQLdb/connections.py", line 221, in __init__
    self.set_character_set(charset)
  File "/Users/pengfei/Code/gengmei/.gaia/lib/python2.7/site-packages/MySQLdb/connections.py", line 312, in set_character_set
    super(Connection, self).set_character_set(charset)

Tom Evans

unread,
Nov 17, 2015, 8:27:03 AM11/17/15
to django...@googlegroups.com
On Tue, Nov 17, 2015 at 11:44 AM, Pengfei Xue <pen...@gmail.com> wrote:
> yesterday, i upgraded my local mysql server to 5.7.9 (mysql Ver 14.14
> Distrib 5.7.9, for osx10.11 (x86_64) using EditLine wrapper), and
> found i can not make my app run anymore, find this error, is there some one
> else get this error before?
>
> MySQL-python==1.2.5

mysql-python (MySQLdb) uses a C extension that would be dynamicly
linked to the mysql client libraries from your older version of mysql.
Did you reinstall and recompile this after upgrading to a newer
version of the client libraries?

Another alternative is that mysql server no longer supports the client
API that mysql-python is presenting. You can mostly connect to older
servers using newer client libraries, you can't always connect to
newer servers using older client libraries. There are alternative
mysql/python connectors available:

https://docs.djangoproject.com/en/1.8/ref/databases/#mysql-db-api-drivers

Cheers

Tom

Pengfei Xue

unread,
Nov 17, 2015, 10:20:47 AM11/17/15
to Django users
thanks, i reinstall mysql-python, it's working now, very frustrating. 

Pengfei Xue

unread,
Nov 17, 2015, 10:20:55 AM11/17/15
to Django users
thanks, i reinstall mysql-python, it's working now, very frustrating. 


On Tuesday, November 17, 2015 at 9:27:03 PM UTC+8, Tom Evans wrote:
Reply all
Reply to author
Forward
0 new messages