Search code examples
mysqlpython-3.xmysql-python

Mysql Connector 8.0 and Python 3.8


I am using Windows 10. I have python 3.8.2 32 bit installed. I am trying to use mysql-installer-web-community-8.0.20.0.msi the connector for Python. The connectors are grayed out and not available. The error message says Python 32-bit not installed. I see old threads claiming you need Python 3.4. The documentation here: https://dev.mysql.com/doc/connector-python/en/connector-python-versions.html claims this will work with Python 3.8.2. Do I need a different MySql installer? If not, what am I doing wrong?

Thanks, Scott


Solution

  • I am not sure why I was using the MySQL installer to install libraries for Python. In hind-sight, that doesn't make sense. Use pip to install the drivers like

    $ pip install mysql-connector-python
    # or
    $ python pip install mysql-connector
    # or for >= Python 3.9
    $ pip install mysqlclient 
    

    It is not entirely clear what the difference is, but, the first of the three solved the problem.