db_config.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import pymysql
  2. from sqlalchemy import create_engine
  3. # 线上数据库连接字符串
  4. # db_con_str = "mysql+pymysql://%s:%s@%s:%d/%s" % ("readonly", "hcst@2021", "139.186.27.96", 4000, "jeecg-boot")
  5. # 测试数据库连接字符串
  6. db_con_str = "mysql+pymysql://%s:%s@%s:%d/%s" % ("hcst", "hcst@2020", "139.186.151.174", 3306, "jeecg-boot")
  7. engine = create_engine(db_con_str, connect_args={'charset': 'utf8'})
  8. # 创建计划url
  9. create_campaign_url = "http://192.168.1.8:8080/jeecg-boot/kuaishou/create/campaignCreate"
  10. # 获取上新视频url
  11. get_new_video_url = "http://192.168.1.8:8080/jeecg-boot/kuaishou/material/getNewVideoList"
  12. # 获取历史视频url
  13. get_history_video_url = "http://192.168.1.8:8080/jeecg-boot/kuaishou/material/getHistoryVideoList"
  14. # 创建组和创意url
  15. create_group_and_creative_url = ""
  16. # import MySQLdb
  17. # if __name__ == '__main__':
  18. # connect = MySQLdb.connect(host="localhost", port=3306,
  19. # user="xxx", passwd="xxx", db='xxx', charset='utf8')
  20. #
  21. # cursor = connect.cursor()
  22. #
  23. # cursor.execute("""
  24. # UPDATE tblTableName
  25. # SET Year=%s, Month=%s, Day=%s, Hour=%s, Minute=%s
  26. # WHERE Server=%s
  27. # """, (Year, Month, Day, Hour, Minute, ServerID))
  28. #
  29. # connect.commit()
  30. # connect.close()