Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MYSQL.CONNECTOR ERROR
#1
I am trying to connect MySQL(8.0.25) and python(3.9.6) using mysql.connector but getting error.
Error:
mysql.connector.errors.ProgrammingError: 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Code:
import mysql.connector as sql 
s=sql.connect(host='localhost' ,user='root', password='<correct password>',database='empl')
The password I entered is the one I use to successfully login to MySQL 8.0 Command line client.
Same code is working for pymysql.connect without any error.
I checked out the Host and User Name by logging in to MYSQL 8.0 Command Line client with my password and typing:
mysql>Select current_user;
And got the Output:
Output:
+----------------+ | current_user | +----------------+ | root@localhost | +----------------+
Thanks in advance.
Kindly help me out as I tried everything but couldn't solve it.
Looking forward for a reply.
Larz60+ write Jul-11-2021, 06:13 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please refrain from using images for code.
Reply


Messages In This Thread
MYSQL.CONNECTOR ERROR - by DB1 - Jul-12-2021, 04:02 PM
RE: MYSQL.CONNECTOR ERROR - by jefsummers - Jul-12-2021, 05:30 PM
RE: MYSQL.CONNECTOR ERROR - by DB1 - Jul-18-2021, 06:43 PM
RE: MYSQL.CONNECTOR ERROR - by menator01 - Jul-18-2021, 08:11 PM
RE: MYSQL.CONNECTOR ERROR - by DB1 - Jul-19-2021, 03:39 AM
RE: MYSQL.CONNECTOR ERROR - by Pedroski55 - Jul-18-2021, 10:24 PM
RE: MYSQL.CONNECTOR ERROR - by DB1 - Jul-19-2021, 03:40 AM
RE: MYSQL.CONNECTOR ERROR - by DB1 - Jul-19-2021, 12:02 PM
RE: MYSQL.CONNECTOR ERROR - by DB1 - Jul-23-2021, 03:31 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Mysql and mysql.connector error lostintime 2 710 Oct-03-2023, 10:25 PM
Last Post: lostintime
  Mysql Syntax error in pymysql ilknurg 4 2,397 May-18-2022, 06:50 AM
Last Post: ibreeden
  Mysql error message: Lost connection to MySQL server during query tomtom 6 16,179 Feb-09-2022, 09:55 AM
Last Post: ibreeden
Question Debian 11 Bullseye | Python 3.9.x | pip install mysql-connector-python-rf problems BrandonKastning 4 6,730 Feb-05-2022, 08:25 PM
Last Post: BrandonKastning
  mysql.connector.errors.ProgrammingError: Failed processing format-parameters; Python ilknurg 3 5,663 Jan-18-2022, 06:25 PM
Last Post: ilknurg
  mySQL Database error not resolving. cybertooth 2 3,246 Aug-30-2021, 05:45 PM
Last Post: ibreeden
  Program stuck at mysql.connector.connect zazas321 1 2,096 Jul-29-2021, 10:49 AM
Last Post: zazas321
  pool mysql error - not catch by try\except? korenron 1 2,159 Jul-05-2021, 11:26 AM
Last Post: ibreeden
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 error from Mysql call AkaAndrew123 1 3,475 Apr-28-2021, 08:16 AM
Last Post: AkaAndrew123
  Error in Mysql Client when upgrading Django Abi 0 1,893 Sep-21-2020, 06:11 AM
Last Post: Abi

Forum Jump:

User Panel Messages

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