19 lines
410 B
Python
19 lines
410 B
Python
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 |