0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SQLAlchemy+PyMySQLを使おうとしたらSHOW VARIABLES LIKE ‘sql_mode'でエラー

Posted at

SQLAlchemyからPyMySQLを使ってMySQL操作をしようしたらエラーが出て動かなかったのでメモ

以下の記事を参考に(というかほぼそのまんま)PyMySQLとSQLAlchemyをインストールして、コードを書いて実行してみましたがエラー
SQLAlchemy + MySQL を使ってみる(その1)

エラーメッセージをよく見てみると以下のSQLでエラーが出てるみたい
SHOW VARIABLES LIKE ‘sql_mode'

実際にMySQLにログインして同じSQLを打ってもエラーが起きるので調べてみると以下がヒット
mysql Table 'performance_schema.session_variables' doesn't existのエラー
書いてある通りに実行してみる

mysql_upgrade -u root -p --force

mysql.server restart

これで再度実行すると、ちゃんとMySQLからデータを取ってくることが出来ました

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?