fromsqlalchemyimportcreate_engine# 替换为你的数据库信息DATABASE_URI='mysql+pymysql://username:password@localhost:3306/mydatabase'# 创建数据库引擎engine=create_engine(DATABASE_URI)# 测试连接try:connection=engine.connect()print("数据库连接成功!")exceptExceptionase:print("数据库连接失败:",e)finally:...