📜  如何在 python 中连接到 mysql 数据库 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:13.689000             🧑  作者: Mango

代码示例3
from sqlalchemy import types, create_engine
import pymysql

try:
    conn = create_engine('mysql+pymysql://user:pass@IP/database_name')
      print("MySQL Connection Sucessfull!!!!!!!!!!!")

except Exception as err:

    print("MySQL Connection Failed !!!!!!!!!!!")
    print(err)