I'm trying make a connection with my database, i see many videos trying to make a connection but te error still the same, if someone can help me.
code:
import psycopg2
def connect_to_db():
try:
conn = psycopg2.connect(
dbname="spotify",
user="postgres",
password="minhasenha",
host="localhost",
port="5432",
options="-c client_encoding=UTF8"
)
print("Connection successful")
except Exception as e:
print(f"Error: {e}")
if name == "main":
connect_to_db()
error:
'utf-8' codec can't decode byte 0xe7 in position 78: invalid continuation byte'
everthing is on
OBS: If you can explain it in Portuguese I would be grateful