Accessing MySQL from Python 3: Access denied for user

前端 未结 8 1660
鱼传尺愫
鱼传尺愫 2021-01-12 05:16

I tried to access MySQL from Python 3.3 with the following methods:

import mysql.connector

config = {
  \'user\': \'###\',
  \'password\': \'******\',
  \'h         


        
8条回答
  •  不知归路
    2021-01-12 05:47

    I would like to add one more possibilities for the cause: version mismatch between your MySQL and mysql-connector-python. This problem happened to me when I was using MySQL 5.6.24-72.2-log and mysql-connector-python==8.0.13. Downgrading to mysql-connector-python==8.0.5 resolved the issue. Though I was using Python 2, hopefully this would provide more clues for debugging.

提交回复
热议问题