I am using python 3.6 with module mysql.connector for connecting my mysql database. Error is like this:-
Traceback (most recent call last):
File "C:/Users/Aditya/Desktop/CS Project/front end test 2.py", line 3, in <module>
db = c.connect(host='localhost', user='root', passwd='M@aditya08', database='showroom')
File "C:\Users\Aditya\AppData\Local\Programs\Python\Python36-32\lib\site-packages\mysql\connector\__init__.py", line 179, in connect
return MySQLConnection(*args, **kwargs)
File "C:\Users\Aditya\AppData\Local\Programs\Python\Python36-32\lib\site-packages\mysql\connector\connection.py", line 95, in __init__
self.connect(**kwargs)
File "C:\Users\Aditya\AppData\Local\Programs\Python\Python36-32\lib\site-packages\mysql\connector\abstracts.py", line 716, in connect
self._open_connection()
File "C:\Users\Aditya\AppData\Local\Programs\Python\Python36-32\lib\site-packages\mysql\connector\connection.py", line 210, in _open_connection
self._ssl)
File "C:\Users\Aditya\AppData\Local\Programs\Python\Python36-32\lib\site-packages\mysql\connector\connection.py", line 142, in _do_auth
auth_plugin=self._auth_plugin)
File "C:\Users\Aditya\AppData\Local\Programs\Python\Python36-32\lib\site-packages\mysql\connector\protocol.py", line 102, in make_auth
auth_data, ssl_enabled)
File "C:\Users\Aditya\AppData\Local\Programs\Python\Python36-32\lib\site-packages\mysql\connector\protocol.py", line 58, in _auth_response
auth = get_auth_plugin(auth_plugin)(
File "C:\Users\Aditya\AppData\Local\Programs\Python\Python36-32\lib\site-packages\mysql\connector\authentication.py", line 191, in get_auth_plugin
"Authentication plugin '{0}' is not supported".format(plugin_name))
mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password' is not supported
I crosschecked my username and host but still getting this error.
You have probably installed mysql-connector instead of mysql-connector-python. So you need to install it again for python3:
pip3 install mysql-connector-python
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.