MySQL 8 - caching_sha2_password
Posted by:
Sasi Tovi
Date: November 21, 2020 06:51AM
Hello,
I'm using MySQL 8.0.21 and I'm getting the following error message:
"_mysql_exceptions.OperationalError: (1045, 'Plugin caching_sha2_password could not be loaded: it is already loaded')"
all the users are using the plugin of caching_sha2_password and the default_authentication_plugin is also set to caching_sha2_password
the full error is:
stacktrace: "Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1811, in full_dispatch_request
rv = self.preprocess_request()
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2087, in preprocess_request
rv = func()
File "/src/secdo/single_tenant_services/agent_api/main.py", line 112, in validate_token
agent_id, token = AgentTokenService.validate(token)
File "/src/secdo/business_logic/agent/token/agent_token_service.py", line 83, in validate
saved_token = list(obs.fetch(agent_id_filter))
File "/src/secdo/observers/agent_tokens_observer.py", line 30, in fetch
res = dao.fetch(parsed_filters, query_params)
File "/src/secdo/core/data_access/agent_token_dao.py", line 29, in fetch
return self.execute(sql, filter_params)
File "/src/secdo/core/databases/mysql/mysql.py", line 163, in execute
raise e
File "/src/secdo/core/databases/mysql/mysql.py", line 143, in execute
pre_execution_queries=pre_execution_queries)
File "/src/secdo/core/databases/mysql/mysql.py", line 71, in _execute
with self.mysql_pool.getcursor(commit=commit, search_path=self._get_search_path()) as cur:
File "/usr/local/lib/python3.6/contextlib.py", line 81, in __enter__
return next(self.gen)
File "/src/secdo/core/databases/mysql/mysql_pool.py", line 64, in getcursor
with self.getconn(commit=commit) as conn:
File "/usr/local/lib/python3.6/contextlib.py", line 81, in __enter__
return next(self.gen)
File "/src/secdo/core/databases/mysql/mysql_pool.py", line 44, in getconn
connection = self.engine.pool.connect()
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py", line 434, in connect
return _ConnectionFairy._checkout(self)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py", line 831, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py", line 563, in checkout
rec = pool._do_get()
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py", line 1259, in _do_get
self._dec_overflow()
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 67, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 277, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py", line 1256, in _do_get
return self._create_connection()
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py", line 379, in _create_connection
return _ConnectionRecord(self)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py", line 508, in __init__
self.__connect(first_connect_check=True)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py", line 710, in __connect
connection = pool._invoke_creator(self)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py", line 336, in <lambda>
return lambda crec: creator()
File "/src/secdo/core/databases/mysql/mysql_connection.py", line 39, in mysql_connect
connect_timeout=config.MysqlConf.connect_timeout)
File "/usr/local/lib/python3.6/site-packages/MySQLdb/__init__.py", line 85, in Connect
return Connection(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/MySQLdb/connections.py", line 204, in __init__
super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1045, 'Plugin caching_sha2_password could not be loaded: it is already loaded')"
Do you have any idea on how to solve this?
Thanks,
stovi