switchon@lavalamp.biz
+27(0) 83 419 4851 / +27(0) 21 036 1165
Application & software development
Get A Quote

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact
    pull requests
    Pull Requests
    Nov 15, 2019
    laravel eloquent
    Working With Eloquent: API Resources In Laravel – Part 2
    Nov 29, 2019

    Getting Django To Talk To MySQL 8

    Categories
    • Software Development
    • Web Development
    Tags
    • database
    • digital ocean
    • django
    • mysql
    • mysql 8
    • server
    getting django to talk to mysql 8
    getting django to talk to mysql 8

    Recently I needed to move a Django database from MySQL 5.7 to MySQL 8. DigitalOcean currently only offers MySQL version 8 as a managed database. I moved the data from the old db to the new db using mysqldump and tried to connect to the database from Django when I got this error: ERROR 2026 (HY000): SSL connection error:

    After searching for this error, it turns out it’s caused by using a MySQL 5.7 client to connect to a MySQL 8 database. So I tried upgrading the standard mysqlclient packages in my django project but that didn’t work. It still returned the same error.
    It turns out there is a different mysql pip package for python that supports MySQL 8 so I installed the new package:
    pip uninstall mysqlclient
    pip install mysql-connector-python

    I only had to make 2 changes to the settings.py file to get it to work: The Database ENGINE which changed to ‘mysql.connector.django’, and Adding an ‘OPTIONS’ key with ‘use_pure’: True.

    Below is what the DATABASES dictionary looks like in settings.py:

    DATABASES = {
    'default': {
    'ENGINE': 'mysql.connector.django',
    'NAME': '****',
    'USER': '****',
    'PASSWORD': '****',
    'HOST': '****',
    'PORT': '****',
    'OPTIONS': {
    "use_pure": True
    }
    }
    }
    view raw settings.py hosted with ❤ by GitHub

    Contact us


      Related posts:

      dynamic doughnut graph using laravel vue componentDynamic Doughnut Graph Using Laravel Vue Component laravel envoyer and forgeProvisioning A New Digital Ocean Server With Laravel Forge, And Deploying Code With Laravel Envoyer errors in app insightsUnhandled Promises Sent Through To App Insights In Node JS sage apiGetting Your Sage One Company ID For API Integration
      Share
      50
      Tielman Janse van Vuuren
      Tielman Janse van Vuuren
      Tielman is an experienced mobile and backend developer. Quality is his motto, no matter what programming language or platform.

      1 Comment

      1. Ano says:
        Feb 1, 2022 at 10:10 am

        I’ve been going through a lot of articles… finally this solved my problem. Thank you very much!!

        Reply

      Leave a Reply Cancel reply

      Your email address will not be published. Required fields are marked *

      Lava Lamp Lab


      Like technology, a lava lamp constantly changes form, producing new conditions with every passing moment



      lava lamp lab facebook   lava lamp lab twitter   lava lamp lab linkedin   lava lamp lab instgram

      Services


      Application & software development

      Outsourced software development

      Project based resourcing

      Digital marketing & consulting

      Graphic design & consulting

      UI / UX design & consulting

      Contact Us


      +27(0) 83 419 4851

      +27(0) 21 036 1165


      switchon@lavalamp.biz


      Unit 4 Monaco Square,
      14 Church Street,
      Durbanville,
      Cape Town, 7550

      NBConsult Group


      nbconsult
      nbconnect msp
      nbclearning
      river broadband
      designer needed
      © 2023 Lava Lamp Lab (Pty) Ltd | All Rights Reserved | Privacy Policy
      Contact us now

        Application & software development

          Outsourced software development

            Project based resourcing

              Digital marketing & consulting

                Graphic design & consulting

                  UI/UX design & consulting

                    Lease an expert

                      Recruitment services

                        We are using cookies to give you the best experience on our website.

                        You can find out more about which cookies we are using or switch them off in settings.

                        Lava Lamp Lab
                        Powered by  GDPR Cookie Compliance
                        Privacy Overview

                        This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

                        Strictly Necessary Cookies

                        Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

                        If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.

                        3rd Party Cookies

                        This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.

                        Keeping this cookie enabled helps us to improve our website.

                        Please enable Strictly Necessary Cookies first so that we can save your preferences!

                        Cookie Policy

                        More information about our Cookie Policy