11 lines
216 B
Python
11 lines
216 B
Python
import getpass
|
|
|
|
def get_mysql ():
|
|
u = getpass.getuser()
|
|
f = open("/home/"+u+"/.my.cnf", "r")
|
|
i = f.read()
|
|
p = i.find("password=")
|
|
ro = i.find ("[clientreadonly]")
|
|
p = i[p+9:ro-2]
|
|
return p
|