This commit is contained in:
2023-11-24 11:33:07 +01:00
parent b225c2bc71
commit 6806381e70
9 changed files with 166 additions and 56 deletions

View File

@ -1,10 +1,13 @@
import getpass
def get_mysql ():
def get_mysql():
u = getpass.getuser()
f = open("/home/"+u+"/.my.cnf", "r")
i = f.read()
u = i.find("user=")
p = i.find("password=")
ro = i.find ("[clientreadonly]")
u = i[u+5:p-1]
ro = i.find("[clientreadonly]")
p = i[p+9:ro-2]
return p
return u, p