-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
38 lines (38 loc) · 1002 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import random
import pymysql
import pymysql.cursors
import re
import ssl
import smtplib
user=''
'''
EMAIL PARAMETERS
'''
email_sender='carlosarzez25@gmail.com'
email_password='ohkkhnkblfckdmhn'
email_receiver=''
subject="Envio contraseña y password"
body=""
"""
MQTT BROKER PARAMETERS
"""
broker = 'ec2-44-204-178-128.compute-1.amazonaws.com'
port = 1883
topic = "WSNPIIData"
client_id = f'python-mqtt-{random.randint(0, 100)}'
username = 'carlos'
password = 'carlos123'
usernameDisplay=''
def obtener_conexion():
connection = pymysql.connect(host='localhost',
user='root',
password='Carlos123#',
database='WSNProjectII')
with connection:
with connection.cursor() as cursor:
sql = "SELECT * FROM `user` WHERE password=SHA1('123')"
cursor.execute(sql)
result = cursor.fetchone()
print(result)
if __name__ == '__main__':
obtener_conexion()