ADD mysql_connect.py
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import mysql.connector
|
||||
|
||||
mydb = mysql.connector.connect(
|
||||
host="172.17.1.21",
|
||||
user="root",
|
||||
password="N53yBCswuawzBzS445VNAhWVMs3N59Gb9szEsrzXRBzarDqpdETpQeyt5v5CGe",
|
||||
database="Stines-GmbH"
|
||||
)
|
||||
|
||||
|
||||
def get_ip(query):
|
||||
cursor = mydb.cursor()
|
||||
cursor.execute(query)
|
||||
return cursor.fetchall()
|
||||
|
||||
def get_database():
|
||||
cursor = mydb.cursor()
|
||||
cursor.execute('SHOW DATABASES')
|
||||
return cursor
|
||||
Reference in New Issue
Block a user