mysql_dev.py 475 B

12345678910111213141516171819
  1. """
  2. @author: luojunhui
  3. """
  4. import pymysql
  5. connection = pymysql.connect(
  6. host='rm-bp1159bu17li9hi94.mysql.rds.aliyuncs.com',
  7. port=3306,
  8. user='crawler',
  9. password='crawler123456@',
  10. db='piaoquan-crawler',
  11. charset='utf8mb4'
  12. )
  13. sql = "select accountName, updateTime from official_articles where ghId = '' order by updateTime DESC;"
  14. cursor = connection.cursor()
  15. cursor.execute(sql)
  16. response = cursor.fetchall()
  17. print(response[0])