Python Forum
Python 3.8 -- mysql-connector error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python 3.8 -- mysql-connector error
#1
In my earlier post, it was reported that pip install of some packages fails in case of python 3.8, while there is no such problem for python 3.7.4

It is further observed that in case of mysql-connector, though pip install is successful in both versions, python 3.8 throws error on running relevant code, while the execution is smooth on python 3.7.4

Sample code:
import mysql.connector

mydb = mysql.connector.connect(
    host="localhost",
    user="adt",
    passwd="adt-MSQR"
)

print(mydb)
Output (Python-3.7.4):
Output:
<mysql.connector.connection_cext.CMySQLConnection object at 0x00000299018E8548>
On the other hand, if same code is run on python 3.8, following error is encountered:
Error:
Traceback (most recent call last): File "J:\AdtPython-Practice\MySQL\msqTest.py", line 12, in <module> mydb = mysql.connector.connect( File "C:\Program Files\Python38\lib\site-packages\mysql\connector\__init__.py", line 179, in connect return MySQLConnection(*args, **kwargs) File "C:\Program Files\Python38\lib\site-packages\mysql\connector\connection.py", line 95, in __init__ self.connect(**kwargs) File "C:\Program Files\Python38\lib\site-packages\mysql\connector\abstracts.py", line 716, in connect self._open_connection() File "C:\Program Files\Python38\lib\site-packages\mysql\connector\connection.py", line 208, in _open_connection self._do_auth(self._user, self._password, File "C:\Program Files\Python38\lib\site-packages\mysql\connector\connection.py", line 137, in _do_auth packet = self._protocol.make_auth( File "C:\Program Files\Python38\lib\site-packages\mysql\connector\protocol.py", line 99, in make_auth packet += self._auth_response(client_flags, username, password, File "C:\Program Files\Python38\lib\site-packages\mysql\connector\protocol.py", line 58, in _auth_response auth = get_auth_plugin(auth_plugin)( File "C:\Program Files\Python38\lib\site-packages\mysql\connector\authentication.py", line 190, in get_auth_plugin raise errors.NotSupportedError( mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password' is not supported
Any Clue?
A.D.Tejpal
Reply
#2
check this -
https://stackoverflow.com/questions/5024...rted-mysql
https://stackoverflow.com/questions/5055...-supported
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
(Oct-26-2019, 02:57 PM)buran Wrote: check this -

Thanks buran. The problem stands resolved.

It is found that whereas mysql-connector was adequate for python 3.7.4, it is necessary to install mysql-connector-python for python 3.8 (otherwise, it leads to error).
A.D.Tejpal
Reply
#4
I believe mysql-connector-python was the correct/offical one for long time now
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#5
watched the following video: https://www.youtube.com/watch?v=tGinfzlp0fE

followings the below steps :

MySQL-connector causes a problem.
pip uninstall MySQL-connector

The following may not need but removed both connectors completely.
pip uninstall MySQL-connector-python

re-install MySQL-connect-python connector.
pip install MySQL-connector-python
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020