cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem with the database connection

Hi, I'm trying to connect Python with my database, this is the script I'm using:

#############################

import mysql.connector
dbConnect = {
'host':'host',#my host is my ip addres in hosting
'port':3306,
'user':'user', #colocar user
'password':'password',#colocar Password
'database':'db',#nombre de la base de datos
}
conexion=mysql.connector.connect(**dbConnect)
cursor = conexion.cursor()
sql="select*from ceiq_posts"
cursor.execute(sql)
resultados=cursor.fetchall()
print(resultados)

###################################

The error that comes to me is the following
mysql.connector.errors.ProgrammingError: 1045 (28000): Access denied for user 'richar' @ 'ip adress' (using password: YES)

 

I already reset the password in the cpanel and I still have the same error.
Maybe someone could help me?

1 REPLY 1

Re: Problem with the database connection

Your host should be "localhost", is that what you have there?