from sqlalchemy import create_engine import pymysql # 线上数据库连接字符串 # host = "139.186.151.174" # port = 3306 # user = "hcst" # passwd = "hcst@2020" # db = 'jeecg-boot' # charset = 'utf8' # db_con_str = "mysql+pymysql://%s:%s@%s:%d/%s" % ("readonly", "hcst@2021", "139.186.27.96", 4000, "jeecg-boot") # 测试数据库连接字符串 host = "139.186.151.174" port = 3306 user = "hcst" passwd = "hcst@2020" db = 'jeecg-boot' charset = 'utf8' db_con_str = "mysql+pymysql://%s:%s@%s:%d/%s" % ("hcst", "hcst@2020", "139.186.151.174", 3306, "jeecg-boot") engine = create_engine(db_con_str, connect_args={'charset': 'utf8'})