DataBaseConfig.py 643 B

123456789101112131415161718192021222324252627
  1. from sqlalchemy import create_engine
  2. import pymysql
  3. # 线上数据库连接字符串
  4. # host = "139.186.151.174"
  5. # port = 3306
  6. # user = "hcst"
  7. # passwd = "hcst@2020"
  8. # db = 'jeecg-boot'
  9. # charset = 'utf8'
  10. # db_con_str = "mysql+pymysql://%s:%s@%s:%d/%s" % ("readonly", "hcst@2021", "139.186.27.96", 4000, "jeecg-boot")
  11. # 测试数据库连接字符串
  12. host = "139.186.151.174"
  13. port = 3306
  14. user = "hcst"
  15. passwd = "hcst@2020"
  16. db = 'jeecg-boot'
  17. charset = 'utf8'
  18. db_con_str = "mysql+pymysql://%s:%s@%s:%d/%s" % ("hcst", "hcst@2020", "139.186.151.174", 3306, "jeecg-boot")
  19. engine = create_engine(db_con_str, connect_args={'charset': 'utf8'})