How to Configure SQL Connector Using Python 3

import mysql.connector

myhost = “https://sql312.epizy.com
myuser = “epiz_24031569”
mypass = “**************” #Panel Password
mydbna = “epiz_24031569_mytradedb”

try:
conn = mysql.connector.connect(user=myuser, password=mypass, host=myhost, database=mydbna)
mycursor = conn.cursor()

mySql = "SELECT * FROM aremas WHERE resta = 'A'"
mycursor.execute(mySql)
usrmas = mycursor.fetchall()
for rows in aremas:
    print(rows)

mycursor.close()

except:
print(“No Connection Database !”)

It’s Doest work Connection

You can’t either do Remote MySQL on this hosting or use https while connecting over a MySQL database host. If you want to do Remote MySQL, Please consider to upgrade the account to Premium Hosting as it offers many features.

1 Like

OK, Thanks, for the sugestion

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.