连接mysql时,报错:TypeError: __init__() got an unexpected keyword argument 'check_same_thread'
我用的mysql数据库,但执行:
Base.metadata.create_all(bind=engine)
时,报错:
TypeError: __init__() got an unexpected keyword argument 'check_same_thread'
请问如何解决?
PS,数据库配置代码
pymysql pymysql.install_as_MySQLdb() SQLALCHEMY_DATABASE_URL = engine = create_engine( SQLALCHEMY_DATABASE_URL==={: } ) SessionLocal = sessionmaker(=engine===) Base = declarative_base(=engine=)
版本
PyMySQL 1.0.2
mysql 8.0