To retrieve data from MySQL:
import devart.mysql as mysql
connect()
module method and obtain a connection
object.
my_connection = mysql.connect(
Server="your_server",
Database="your_database",
UserId="your_username",
Password="your_password"
)
cursor
object using the cursor()
connection method.
my_cursor = my_connection.cursor()
execute()
cursor method.
my_cursor.execute("SELECT * FROM employees")
fetch*()
cursor methods.
for row in my_cursor.fetchall():
print(row)