Oct-20-2022, 07:04 PM
In my Python code, I have my username and password entered as plain text. But this is not the best practice since now anyone that see my code also knows the database root username and password. How can I 'hide' the password here? I watched a YouTube video, but is this the best way?
Python Quick Tip: Hiding Passwords and Secret Keys in Environment Variables (Windows)
1 2 3 4 5 6 |
mydb = mysql.connector.connect( host = "localhost" , user = "root" , password = "mydbpw" , database = "users" ) |