I run the batch file like this:

mysqldump.exe --user=uuu --password=pswd --host=localhost --port=3306 --result-file="c:\mydata\backups\db_backup.%date:~0,2%-%date:~3,2%-%date:~6,4%_%time:~0,2%.%time:~3,2%.%time:~6,2%.sql" --default-character-set=utf8 --single-transaction=TRUE --databases "mydb"

in Windows Task Scheduler, but I don't like the fact that I pass the mysql user's password like this. Is there a way to keep the password but pass it more securely?

  • 1
    You cannot secure the password in the commandline of mysqldump. Do it on the OS level. PS. You may use MySQL account which have no any privileges except this database backup.
    – Akina
    Sep 7, 2020 at 11:50
  • @Akina What exactly do you mean by OS level here? Hiding or encrypting the batch file? Sep 7, 2020 at 12:09
  • Any technique. I'd prefer to create an utility which will start dumping process with the settings when this child process cannot be investigated/interfered.
    – Akina
    Sep 7, 2020 at 12:25
  • @Akina I've also noticed that in User table of mysql database there are uninitialized rows: ssl_type and ssl_cipher. Can I use SSL somehow instead of using password to secure my data? If yes then how can I do that? Sep 7, 2020 at 13:51
  • See if mysql_config_editor provides a solution on Windows.
    – Rick James
    Sep 7, 2020 at 16:31


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.