1. Use the pip command to install MySQL connector Python. pip install mysql-connector-python 2. Import using a import mysql.connector statement so you can use this module's methods to communicate with the MySQL database. 3. Use the connect() method of the MySQL Connector class with the required arguments to connect MySQL. It would return a MySQLConnection object if the connection established successfully
確定! 回上一頁