-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
questionUsability question, not directly related to an error with the imageUsability question, not directly related to an error with the image
Description
If I deploy mysql server to K8S cluster using mysql docker image(version: 5.7.22)
and request connection with python-SQLAlchemy(pymysql)
flask server returns below errors.
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/dialects/mysql/base.py", line 2201, in _detect_sql_mode
connection.execute("SHOW VARIABLES LIKE 'sql_mode'"),
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 942, in execute
return self._execute_text(object, multiparams, params)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1104, in _execute_text
statement, parameters
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
context)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1413, in _handle_dbapi_exception
exc_info
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 186, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
context)
File "/usr/local/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 507, in do_execute
cursor.execute(statement, parameters)
File "/usr/local/lib/python3.5/site-packages/pymysql/cursors.py", line 165, in execute
result = self._query(query)
File "/usr/local/lib/python3.5/site-packages/pymysql/cursors.py", line 321, in _query
conn.query(q)
File "/usr/local/lib/python3.5/site-packages/pymysql/connections.py", line 860, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/local/lib/python3.5/site-packages/pymysql/connections.py", line 1061, in _read_query_result
result.read()
File "/usr/local/lib/python3.5/site-packages/pymysql/connections.py", line 1356, in read
self._read_result_packet(first_packet)
File "/usr/local/lib/python3.5/site-packages/pymysql/connections.py", line 1422, in _read_result_packet
self._read_rowdata_packet()
File "/usr/local/lib/python3.5/site-packages/pymysql/connections.py", line 1456, in _read_rowdata_packet
packet = self.connection._read_packet()
File "/usr/local/lib/python3.5/site-packages/pymysql/connections.py", line 1018, in _read_packet
packet.check_error()
File "/usr/local/lib/python3.5/site-packages/pymysql/connections.py", line 384, in check_error
err.raise_mysql_exception(self._data)
File "/usr/local/lib/python3.5/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
raise errorclass(errno, errval)
sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1682, "Native table 'performance_schema'.'session_variables' has the wrong structure") [SQL: "SHOW VARIABLES LIKE 'sql_mode'"] (Background on this error at: http://sqlalche.me/e/2j85)
So, I entered the following commands,
mysql_upgrade -u root -p
service mysql restart
It works well.
Is this originally intended actions or just my deploy mistake?
Metadata
Metadata
Assignees
Labels
questionUsability question, not directly related to an error with the imageUsability question, not directly related to an error with the image