web2py fails auth on mysql with 1045 error

25 views
Skip to first unread message

Ivan Gazzola

unread,
May 1, 2022, 1:53:37 PMMay 1
to web2py-users

I'm trying to connect to a new db:

db=DAL('mysql://userx:password@localhost/IgXortho?set_encoding=utf8mb4')

I can login with my user, when I check grants I've got this:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><

mysql> show grants;

+---------------------------------------------------------------+

| Grants for userx@localhost                                   |

+---------------------------------------------------------------+

| GRANT USAGE ON *.* TO `userx`@`localhost`                    |

| GRANT ALL PRIVILEGES ON `IgXortho`.* TO `userx`@`localhost`  |

| GRANT ALL PRIVILEGES ON `ig_xortho`.* TO `userx`@`localhost` I 

 I've tried with common user and with root user but always same problem (you can see 2 db because I've changed name removing underscore from the name):

OperationalError: (1045, u"Access denied for user 'userx'@'localhost' (using password: NO)")

Web2py latest version, python 2.7.18 and MySQL is:

mysql  Ver 8.0.29 for Linux on x86_64 (MySQL Community Server - GPL)


I can't figure out why, it seems like the password doesn't go to the server
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/www/web2py/gluon/packages/dal/pydal/base.py", line 679, in define_table

    table = self.lazy_define_table(tablename, *fields, **kwargs)

  File "/www/web2py/gluon/packages/dal/pydal/base.py", line 720, in lazy_define_table

    polymodel=polymodel,

  File "/www/web2py/gluon/packages/dal/pydal/adapters/base.py", line 943, in create_table

    return self.migrator.create_table(*args, **kwargs)

  File "/www/web2py/gluon/packages/dal/pydal/migrator.py", line 337, in create_table

    self.adapter.create_sequence_and_triggers(query, table)

  File "/www/web2py/gluon/packages/dal/pydal/adapters/base.py", line 1027, in create_sequence_and_triggers

    self.execute(query)

  File "/www/web2py/gluon/packages/dal/pydal/adapters/__init__.py", line 65, in wrap

    if not args[0].connection:

  File "/www/web2py/gluon/packages/dal/pydal/connection.py", line 32, in connection

    return self.get_connection()

  File "/www/web2py/gluon/packages/dal/pydal/connection.py", line 65, in get_connection

    connection = self.connector()

  File "/www/web2py/gluon/packages/dal/pydal/adapters/mysql.py", line 64, in connector

    conn = self.driver.connect(**self.driver_args)

  File "gluon/contrib/pymysql/__init__.py", line 90, in Connect

    return Connection(*args, **kwargs)

  File "gluon/contrib/pymysql/connections.py", line 688, in __init__

    self.connect()

  File "gluon/contrib/pymysql/connections.py", line 906, in connect

    self._request_authentication()

  File "gluon/contrib/pymysql/connections.py", line 1114, in _request_authentication

    auth_packet = self._read_packet()

  File "gluon/contrib/pymysql/connections.py", line 981, in _read_packet

    packet.check_error()

  File "gluon/contrib/pymysql/connections.py", line 393, in check_error

    err.raise_mysql_exception(self._data)

  File "gluon/contrib/pymysql/err.py", line 107, in raise_mysql_exception

    raise errorclass(errno, errval)

gluon.contrib.pymysql.err.OperationalError: (1045, u"Access denied for user 'userx'@'localhost' (using password: NO)")

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<

Reply all
Reply to author
Forward
0 new messages