Mysql shell script without password exposure

Suppose your username is "db_user". Running from the shell prompt:

mysql_config_editor set --login-path=local --host=localhost --user=db_user --password

It prompts for the password. Once you enter it, the user/pass are saved encrypted in your home/system_username/.mylogin.cnf

write the password between "" if contains spacial character, like "#" or "." ex: "Passw#rd"

Of course, change "system_username" to your username on the server.

Change your bash script from this:

mysqldump -u db_user -pInsecurePassword my_database | gzip > db_backup.tar.gz

to this:

mysqldump --login-path=local my_database | gzip > db_backup.tar.gz


mysql --login-path=local -D DATABASE -e "SELECT * FROM table LIMIT 10"

Install MSIX with powershell

 Add-AppxPackage -Path "C:\Users\MyUserName\Downloads\affinity-designer-2.0.0.msix" -DependencyPath " https://aka.ms/Microsof...

Mais vistos