代码示例:(标识:demo_python_mysql_test)
demo_python_mysql_test.py
import mysql.connector

#if this page is executed with no errors, you have the "mysql.connector" module installed.
运行结果: