【发布时间】:2021-02-18 10:30:48
【问题描述】:
当我运行 SQL python 脚本时,出现了这些错误
MySQLdb._exceptions.OperationalError: (1698, "Access denied for user 'root'@'localhost'")
sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (1698, "Access denied for user 'root'@'localhost'")
(Background on this error at: http://sqlalche.me/e/13/e3q8)
我查看了 mysql.user 表并得到以下信息:
+------------------+-----------+-----------------------+
| User | Host | plugin |
+------------------+-----------+-----------------------+
| debian-sys-maint | localhost | caching_sha2_password |
| mysql.infoschema | localhost | caching_sha2_password |
| mysql.session | localhost | caching_sha2_password |
| mysql.sys | localhost | caching_sha2_password |
| root | localhost | auth_socket |
+------------------+-----------+-----------------------+
【问题讨论】:
标签: python mysql python-3.x linux sqlalchemy