PyMySQL/Tornado-MySQL

Cannot connect to MySQL after upgrade to v8

AivanF opened this issue · 1 comments

I have a huge website with Tornado-MySQL which code I haven't modified for almost 2 years because it worked fine all this time. However, a day ago I updated MySQL Server from 5.7 to 8 (because of needs of my another project on that server), and now my Tornado website doesn't work: Tornado-MySQL cannot connect to the new MySQL Server. Here is the error text:

ERROR:tornado.application:Future exception was never retrieved: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/aivanf/Tornado/database.py", line 33, in execute
    cur = yield POOL.execute(query, params)
  File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 261, in result
    raise_exc_info(self._exc_info)
  File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/usr/local/lib/python2.7/dist-packages/tornado_mysql/pools.py", line 122, in execute
    conn = yield self._get_conn()
  File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 261, in result
    raise_exc_info(self._exc_info)
  File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/usr/local/lib/python2.7/dist-packages/tornado_mysql/__init__.py", line 88, in connect
    yield conn.connect()
  File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 261, in result
    raise_exc_info(self._exc_info)
  File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/usr/local/lib/python2.7/dist-packages/tornado_mysql/connections.py", line 823, in connect
    2003, "Can't connect to MySQL server on %r (%s)" % (self.host, e))
OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' (255)")

Below are listed the versions of my packages. I have updated them to last available ones.

  • OS: Ubuntu 16.04.5 LTS
  • MySQL: 8.0.13
  • Python: checked both 2.7 and 3.5
  • Tornado: 5.1.1
  • Tornado-MySQL: 0.5.1

In addition, during installation of MySQL Server 8, I specified to use legacy users stuff to maintain compatibility with my Python apps, and MySQLdb package (also called mysqlclient, version 1.3.13) works well.

How to fix the problem??

This project is not under development.
No plan for support new MySQL auth method.
You need to change default auth method to native_password, or switch to aio-mysql.