When user specify a password in MySQL cli, aka -pXXXXXX
, the password parameter is replaced to -p******
in argv array.
So when someone check the process list with ps
, they can't see the password.
How can I do the same in Python? This doesn't work obviously
for arg in sys.argv[1:]:
arg = ""
sys.argv = [sys.argv[0]]
works and is more efficient and elegant than deleting all but the first element. I can't confirm this would overwrite or erase previous value of sys.argv in memory though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With