[web2py] Error connecting to MySQL 8.0

2019-02-15 Thread msdexp555
Hi!

I had previously MySQL 5.5 and web2py 2.9.12 on the local machine, OS 
Windows 10. My connection strinq

db = DAL("mysql://root:passw@127.0.0.1/dbname", db_codec = 'UTF-8')

was working fine. I am having now MySQL 8.0 and any of the strings 

db = DAL("mysql://root:passw@127.0.0.1/dbname", db_codec = 'UTF-8')
db = DAL("mysql://root:passw@localhost/dbname", db_codec = 'UTF-8')
db = DAL("mysql://user:passw@localhost/dbname", db_codec = 'UTF-8')

raises exception "Failure to connect" and message "KeyError: 255". 
How can I solve this problem without changing web2py version?

-- 
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.


[web2py] error connecting to mysql

2019-02-13 Thread Andrea Fae'
Hello. I have this error when I start application "ga"

Error ticket for "ga"
Ticket ID

127.0.0.1.2019-02-13.20-49-28.fcc1a494-3aa4-42c2-b1a9-ab14a466e72e
 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/ga/models/db.py" 
, line 34, in 
check_reserved=['all'])
  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\ga\models\db.py

1.

 at 0AC93830, file 
"C:\web2py\applications\ga\models\db.py", line 8



This is my appconfig.ini:

; App configuration
[app]
name= Welcome
author  = Your Name 
description = a cool new app
keywords= web2py, python, framework
generator   = Web2py Web Framework

; Host configuration
[host]
names = localhost:*, 127.0.0.1:*, *:*, *

; db configuration
[db]
uri   = mysql://root:passwordroot@localhost/gadb?set_encoding=utf8mb4
migrate   = true
pool_size = 10 ; ignored for sqlite

; smtp address and credentials
[smtp]
server = smtp.gmail.com:587
sender = y...@gmail.com
login  = username:password
tls= true
ssl= true

; form styling
[forms]
formstyle = bootstrap3_inline
separator =

I just created the db "gadb" in mysql.exe. You can see the db, but I only 
created the db with the command

mysql> create database gadb; Query OK, 1 row affected (0.02 sec) mysql> 
show databases; ++ | Database | ++ 
| gadb | | information_schema | | mysql | | performance_schema | | sakila | 
| sys | | world | ++ 7 rows in set (0.00 sec) 

Can you help me what is my mistake?
THANK YOU

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (D