Problem:
You need to connect to a external MySQL database and do thing...
Solution:
1.- Install mysql drivers
sudo python3 -m pip install mysql-connector-python
2.- Create a new program using the next code:
import mysql.connectormydb = mysql.connector.connect(host="localhost",user="yourusername",password="yourpassword",database="mydatabase")mycursor = mydb.cursor()mycursor.execute("SELECT * FROM customers")myresult = mycursor.fetchall()for x in myresult:print(x)Sources:
3.- Do thinks...
https://www.w3schools.com/python/python_mysql_getstarted.asp