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"

Updatable objects appear as 'no longer supported'

  Symptoms In some scenarios, the following validation warning appears on an updatable object: " Object is no longer supported. Enforci...

Mais vistos