Hello everyone, I have a problem when I try to connect web2py to a mysql database. I'm using a Debian 9 strech, Web2py 2.18.3-stable + timestamp.2019.03.03.23.22.30 (Running on Apache / 2.4.25, Python 2.7.13) and mysql 8.0.15. I don't have any problem when I use storage.sqlite. But when I try to migrate on Mysql, I always have the same error:
Identifiant du Billet 81.23.32.9.2019-03-05.13-55-17.e8fb714e-4e1d-4e5c-8502-a36374e00a23 <type 'exceptions.RuntimeError'> Failure to connect, tried 5 times: Traceback (most recent call last): File "/home/www-data/web2py/gluon/packages/dal/pydal/base.py", line 455, in __init__ self._adapter = adapter(**kwargs) File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/__init__.py", line 40, in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", line 369, in __init__ super(SQLAdapter, self).__init__(*args, **kwargs) File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", line 53, in __init__ self.reconnect() File "/home/www-data/web2py/gluon/packages/dal/pydal/connection.py", line 172, in reconnect self.connection = self.connector() File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/mysql.py", line 52, in connector return self.driver.connect(**self.driver_args) File "/home/www-data/web2py/gluon/contrib/pymysql/__init__.py", line 90, in Connect return Connection(*args, **kwargs) File "/home/www-data/web2py/gluon/contrib/pymysql/connections.py", line 688, in __init__ self.connect() File "/home/www-data/web2py/gluon/contrib/pymysql/connections.py", line 905, in connect self._get_server_information() File "/home/www-data/web2py/gluon/contrib/pymysql/connections.py", line 1231, in _get_server_information self.server_charset = charset_by_id(lang).name File "/home/www-data/web2py/gluon/contrib/pymysql/charset.py", line 38, in by_id return self._by_id[id] KeyError: 255Version web2py™ Version 2.18.3-stable+timestamp.2019.03.03.23.22.30Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. Traceback (most recent call last): File "/home/www-data/web2py/gluon/restricted.py", line 219, in restricted exec(ccode, environment) File "/home/www-data/web2py/applications/welcome/models/db.py" <https://51.75.248.250/admin/default/edit/welcome/models/db.py>, line 36, in <module> check_reserved=['all']) File "/home/www-data/web2py/gluon/packages/dal/pydal/base.py", line 170, in __call__ obj = super(MetaDAL, cls).__call__(*args, **kwargs) File "/home/www-data/web2py/gluon/packages/dal/pydal/base.py", line 475, in __init__ "Failure to connect, tried %d times:\n%s" % (attempts, tb) RuntimeError: Failure to connect, tried 5 times: Traceback (most recent call last): File "/home/www-data/web2py/gluon/packages/dal/pydal/base.py", line 455, in __init__ self._adapter = adapter(**kwargs) File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/__init__.py", line 40, in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", line 369, in __init__ super(SQLAdapter, self).__init__(*args, **kwargs) File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", line 53, in __init__ self.reconnect() File "/home/www-data/web2py/gluon/packages/dal/pydal/connection.py", line 172, in reconnect self.connection = self.connector() File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/mysql.py", line 52, in connector return self.driver.connect(**self.driver_args) File "/home/www-data/web2py/gluon/contrib/pymysql/__init__.py", line 90, in Connect return Connection(*args, **kwargs) File "/home/www-data/web2py/gluon/contrib/pymysql/connections.py", line 688, in __init__ self.connect() File "/home/www-data/web2py/gluon/contrib/pymysql/connections.py", line 905, in connect self._get_server_information() File "/home/www-data/web2py/gluon/contrib/pymysql/connections.py", line 1231, in _get_server_information self.server_charset = charset_by_id(lang).name File "/home/www-data/web2py/gluon/contrib/pymysql/charset.py", line 38, in by_id return self._by_id[id] KeyError: 255 In file: /home/www-data/web2py/applications/welcome/models/db.py 1. <code object <module> at 0x7f32fd9425b0, file "/home/www-data/web2py/applications/welcome/models/db.py", line 7> I use the following syntax: 'mysql://user:passwd@localhost/gmao?set_encoding=utf8mb4' I also notice this error message when I try to replace storage.sqlite by mysql : An error occured, please <a href="/admin/default/edit/welcome/models/db.py?id=models__db__py">reload</a> the page I have the same error when I try to modify this in appconfig.ini. Thank you all in advance for your help. Arthur -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.