0
Trying to make the connection to my database, but is returning me the following error!
Exception has occurred: Attributeerror 'Connection' Object has no attribute 'execute' Exception has occurred: Attributeerror 'Connection' Object has no attribute 'execute'
Just follow the code
import pymysql
connection = pymysql.connect(host="reveka", user="carga", passwd="carga", db="dw")
if connection:
print ("Conectado!\n")
#Realizando select para testar conexão
mysql = '''\
SELECT * FROM ft_venda
'''
cursor = connection.execute(mysql)
for Tabela in cursor:
print(Tabela)
Did not miss the
cursor = connection.cursor()
?– Germano Buss Niehues