|
@@ -11,11 +11,12 @@ class MysqlClient(object):
|
|
|
|
|
|
def __init__(self):
|
|
|
mysql_config = {
|
|
|
- "host": "rm-bp1159bu17li9hi94.mysql.rds.aliyuncs.com",
|
|
|
+ # "host": "rm-bp1159bu17li9hi94.mysql.rds.aliyuncs.com",
|
|
|
+ "host": "rr-bp1l12ea7e9wgu947.mysql.rds.aliyuncs.com",
|
|
|
"port": 3306, # 端口号
|
|
|
- "user": "crawler", # mysql用户名
|
|
|
- "passwd": "crawler123456@", # mysql用户登录密码
|
|
|
- "db": "piaoquan-crawler", # 数据库名
|
|
|
+ "user": "wx2016_longvideo", # mysql用户名
|
|
|
+ "passwd": " wx2016_longvideoP@assword1234", # mysql用户登录密码
|
|
|
+ "db": "longvideo", # 数据库名
|
|
|
"charset": "utf8mb4" # 如果数据库里面的文本是utf8编码的,charset指定是utf8
|
|
|
}
|
|
|
self.connection = pymysql.connect(
|
|
@@ -57,3 +58,9 @@ class MysqlClient(object):
|
|
|
关闭连接
|
|
|
"""
|
|
|
self.connection.close()
|
|
|
+
|
|
|
+
|
|
|
+M = MysqlClient()
|
|
|
+sql = "SELECT title from crawler_video where id = '19591529';"
|
|
|
+w = M.select(sql)
|
|
|
+print(w)
|