SSL Connection Error while using MySQL Connector with Python

后端 未结 5 2097
余生分开走
余生分开走 2021-01-02 07:38

I\'m using Python 3.6 (but I get the same error with Python 2.7) and mysql-connector-python in an Anaconda\'s environment to code a simple script to access my database hoste

5条回答
  •  没有蜡笔的小新
    2021-01-02 08:31

    I had the same issue and resolved it by adding use_pure=True argument based a suggestion here:

    import mysql.connector as sql
    
    db_connection = sql.connect(host='****', database='****', user='****', password='****', use_pure=True)
    

    Relevant packages on my mac: mysql-connector-python 8.0.16 and openssl 1.1.1b installed (both anaconda).

提交回复
热议问题