Add tunnel to mysql

add any kernel to script generator
This commit is contained in:
2020-12-10 17:23:07 +01:00
parent 74841d5047
commit f3afcd00ba
12 changed files with 215 additions and 74 deletions

View File

@@ -1,7 +1,3 @@
import os
import mysql.connector
class TextColor:
BLUE = "\033[94m"
CYAN = "\033[96m"
@@ -18,15 +14,3 @@ class TextColor:
ENDC = "\033[0m"
BOLD = "\033[1m"
UNDERLINE = "\033[4m"
class MySQL:
@staticmethod
def get_connection():
config = dict()
dir_path = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(dir_path, ".myconfig")) as f:
for line in f.read().splitlines():
key, value = line.split("=")
config[key] = value
return mysql.connector.connect(**config)