MySQL Forums
Forum List  »  Connector/Python

MySql Connector and Python
Posted by: B Holmes
Date: August 15, 2020 12:02AM

Wondering if someone may be able to help me. I've got a Raspberry Pi4 running a Linux server (Ubuntu 20.04 LTS) and have MySql Server installed on it. I'm able to connect via MySql Workbench to the testing db that I created, but when it comes to connecting via mysql.connector in a Python script, I am getting several Framework errors from the .py files in the Python 3.8 Libraries via the terminal. I've pasted the message below. Running Python 3.8 and have mysql-connector-python-8.0.21 installed correctly via the "pip3 install mysql-connector-python" command.I'm on a Mac running the latest version of Catalina. What I'm trying to do is to connect Python to MySql so that I can use Tkinter to create a GUI for the db.

File "testdb1PYTHON.py", line 3, in <module>
mydb = mysql.connector.connect(
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/mysql/connector/__init__.py", line 264, in connect
return CMySQLConnection(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/mysql/connector/connection_cext.py", line 80, in __init__
self.connect(**kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/mysql/connector/abstracts.py", line 966, in connect
self._open_connection()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/mysql/connector/connection_cext.py", line 218, in _open_connection
raise errors.get_mysql_exception(msg=exc.msg, errno=exc.errno,
mysql.connector.errors.ProgrammingError: 1045 (28000): Access denied for user *****

Options: ReplyQuote


Subject
Written By
Posted
MySql Connector and Python
August 15, 2020 12:02AM
August 18, 2020 06:06AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.