Hello, I'm sorry but I'm not able to use web2py with this type of db.
I just installed mysql version 8.0.15 on windows 10 pro and I have
connector for Python 3.7 and 2.7 installed
I created using mysql.exe a db named 'gadb', without any tables.
with web2py I created a new "welcome" application changing db.py in this
way (not using appconfig.ini)
i changed only this:
db = DAL('mysql://root:rootpassword@localhost/gadb',pool_size=20)
commenting this
"""db = DAL(configuration.get('db.uri'),
pool_size=configuration.get('db.pool_size'),
migrate_enabled=configuration.get('db.migrate'),
check_reserved=['all'])"""
but when I try to start the application I have this error:
Error ticket for "testmysql"Ticket ID
127.0.0.1.2019-02-14.20-04-44.4a997a45-2232-4144-ab7e-6005309040bb
<type 'exceptions.RuntimeError'> Failure to connect, tried 5 times:
Traceback (most recent call last): File
"C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__
self._adapter = adapter(**kwargs) File
"C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in
__call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File
"C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in
__init__ super(SQLAdapter, self).__init__(*args, **kwargs) File
"C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in __init__
self.reconnect() File "C:\web2py\gluon\packages\dal\pydal\connection.py",
line 172, in reconnect self.connection = self.connector() File
"C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in
connector return self.driver.connect(**self.driver_args) File
"C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect return
Connection(*args, **kwargs) File
"C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__
self.connect() File "C:\web2py\gluon\contrib\pymysql\connections.py", line
905, in connect self._get_server_information() File
"C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in
_get_server_information self.server_charset = charset_by_id(lang).name File
"C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id return
self._by_id[id] KeyError: 255Versione
web2py™ Version 2.16.1-stable+timestamp.2017.11.14.05.54.25Traceback
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 "C:\web2py\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
File "C:/web2py/applications/testmysql/models/db.py"
<http://127.0.0.1:8000/admin/default/edit/testmysql/models/db.py>, line 33, in
<module>
db = DAL('mysql://root:AeDeFsubfi3!@localhost/gadb',pool_size=20)
File "C:\web2py\gluon\packages\dal\pydal\base.py", line 169, in __call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
File "C:\web2py\gluon\packages\dal\pydal\base.py", line 474, 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 "C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__
self._adapter = adapter(**kwargs)
File "C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in
__call__
obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in
__init__
super(SQLAdapter, self).__init__(*args, **kwargs)
File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in
__init__
self.reconnect()
File "C:\web2py\gluon\packages\dal\pydal\connection.py", line 172, in
reconnect
self.connection = self.connector()
File "C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in
connector
return self.driver.connect(**self.driver_args)
File "C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect
return Connection(*args, **kwargs)
File "C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__
self.connect()
File "C:\web2py\gluon\contrib\pymysql\connections.py", line 905, in connect
self._get_server_information()
File "C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in
_get_server_information
self.server_charset = charset_by_id(lang).name
File "C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id
return self._by_id[id]
KeyError: 255
In file: C:\web2py\applications\testmysql\models\db.py
1.
<code object <module> at 00000000126057B0, file
"C:\web2py\applications\testmysql\models\db.py", line 7
What is my mistake? Thank in advance for who will answer me. Maybe this mysql
is not compatible with web2py 2.16? How can I test if web2py is able to connect
to mysql? After this problem I have to migrate a sqlite application to mysql:
this is my goal. Thank you
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.