# Connecting python to mysql error

**URL:** <https://forum.anaconda.com/t/connecting-python-to-mysql-error/20999>\
**Category:** Packages & Environments\
**Created:** [May 8, 2022, 6:35am UTC](https://forum.anaconda.com/t/connecting-python-to-mysql-error/20999 "2022-05-08T06:35:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chaitanyanaidu1312](https://avatars.discourse-cdn.com/v4/letter/c/db6015/32.png) [@chaitanyanaidu1312](https://forum.anaconda.com/u/chaitanyanaidu1312)\
**Post date:** [May 8, 2022, 6:35am UTC](https://forum.anaconda.com/t/connecting-python-to-mysql-error/20999/1 "2022-05-08T06:35:53Z")

</div>

Guys, can anyone helpme.  
to connet python and mysql on anaconda command prompt  
**conda install -c anaconda mysql-connector-python**

Collecting package metadata (current\_repodata.json): done  
Solving environment: failed with initial frozen solve. Retrying with flexible solve.  
Solving environment: failed with repodata from current\_repodata.json, will retry with next repodata source.  
Collecting package metadata (repodata.json): done  
Solving environment: failed with initial frozen solve. Retrying with flexible solve.  
Solving environment:   
Found conflicts! Looking for incompatible packages.  
This can take several minutes. Press CTRL-C to abort.  
failed

UnsatisfiableError: The following specifications were found  
to be incompatible with the existing python installation in your environment:

Specifications:

- mysql-connector-python → python[version=’\>=3.5,\<3.6.0a0|\>=3.6,\<3.7.0a0|\>=3.7,\<3.8.0a0’]

Your python: python=3.9

If python is on the left-most side of the chain, that’s the version you’ve asked for.  
When python appears to the right, that indicates that the thing on the left is somehow  
not available for the python version you are constrained to. Note that conda will not  
change your python version to a different minor version unless you explicitly specify  
that.

---

<div class="post-metadata">

**Author:** ![Robert\_Stillwell](https://avatars.discourse-cdn.com/v4/letter/r/00a5b5/32.png) [@Robert\_Stillwell](https://forum.anaconda.com/u/Robert_Stillwell)\
**Post date:** [August 9, 2022, 4:20pm UTC](https://forum.anaconda.com/t/connecting-python-to-mysql-error/20999/2 "2022-08-09T16:20:15Z")

</div>

I’m having the same issue that it seems Anaconda does not have the latest MySQL Python Connector package 8.0.30.

Can we request this package to be available?

---

<div class="post-metadata">

**Author:** ![sweller](https://avatars.discourse-cdn.com/v4/letter/s/c2df01/32.png) [@sweller](https://forum.anaconda.com/u/sweller)\
**Post date:** [August 9, 2022, 6:20pm UTC](https://forum.anaconda.com/t/connecting-python-to-mysql-error/20999/3 "2022-08-09T18:20:43Z")

</div>

If you are using python 3.9, you need to install ‘mysql-connector-python’ package from the conda-forge channel to get a later version. This will install ‘mysql-connector-python’ version 8.0.29.

The current version of the package in the anaconda main channel should get updated soon…

---

<div class="post-metadata">

**Author:** ![swetang\_krishna](https://avatars.discourse-cdn.com/v4/letter/s/c2df01/32.png) [@swetang\_krishna](https://forum.anaconda.com/u/swetang_krishna)\
**Post date:** [January 17, 2023, 4:20pm UTC](https://forum.anaconda.com/t/connecting-python-to-mysql-error/20999/4 "2023-01-17T16:20:13Z")

</div>

i’m using python 3.8 and facing the same issue. Is there any other way, shall i update my python version for this to work?

---

<div class="post-metadata">

**Author:** ![sweller](https://avatars.discourse-cdn.com/v4/letter/s/c2df01/32.png) [@sweller](https://forum.anaconda.com/u/sweller)\
**Post date:** [January 24, 2023, 11:31pm UTC](https://forum.anaconda.com/t/connecting-python-to-mysql-error/20999/5 "2023-01-24T23:31:05Z")

</div>

Another option is to simply use the ODBC driver you can download from the MySQL website here:  
[https://dev.mysql.com/downloads/connector/odbc/](https://dev.mysql.com/downloads/connector/odbc/)

and use the pyodbc package to connect.
