4

I'm new to python and django. When I run python manage.py runserver I get this error:

django.db.utils.OperationalError: (2026, 'SSL connection error: SSL_CTX_set_tmp_dh failed')'
mysql Server version: 8.0.13 MySQL Community Server - GPL.

I can't find this error on the web.

3
  • What version of openssl do you have on this server? What mysqlclient or MySQL Connector/Python do you have installed? Commented Nov 20, 2018 at 2:06
  • @danblack 'mysqlclient 1.3.13 py37h1de35cc_0' Commented Nov 20, 2018 at 2:11
  • @danblack My openssl's version:'OpenSSL 1.1.1 11 Sep 2018' Commented Nov 20, 2018 at 2:15

4 Answers 4

7

I had this issue too when installing from Anaconda, but I could work around it using the "use_pure=True" mysql.connector.connect() parameter.

Sign up to request clarification or add additional context in comments.

Comments

5

I ran into the same error when I tried to connect to MySQL to Python (in Anaconda).

This feed is particularly helpful for various case scenarios leading to the same error. For me, installing openSSL version 1.0.2r in Anaconda, itself, fixed the issue:

$ conda install openssl=1.0.2r

1 Comment

After 3 month i quit that issue. this finally solved it. i owe you my life.
0

I got the answer:'https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization.html'

'shell> bin/mysql_ssl_rsa_setup'

Comments

0

Open The file init.py(file under the same directory as settings.py) add the following code:

import pymysql pymysql.install_as_MySQLdb()

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.