In this example we will show how to test if you already have “MySQL Connector” installed in Python.
Source Code
import mysql.connector
# Save this file as the demo_mysql_test.py file and execute it.
# If it was executed with no errors, "MySQL Connector" is installed.