Powershell script while executing mysqldump script I'm having an error 1045: Access denied for user 'mysqlsuperuser'@'test.internal.cloudapp.net' (using password: YES) when trying to connect
Here is the mysqldump command on my ps1 file.
$command = [string]::format(&quot;`&quot;{0}`&quot; -u {1} -p{2} -h {3} --default-character-set=utf8mb4 --quick --master-data=2 --single-transaction --routines --databases test1 --add-drop-database --result-file=`&quot;{5}`&quot; &quot;,
        $mysqlDumpLocation,
        $databaseUsername,
        $databasePassword,
        $databaseIp,
        $database.DatabaseName,
        $saveFilePath);

But when I try to remove the {2} which is the DB password, then execute the ps1 file. When it prompt me for the password, it goes through.
I would guess that there's one or more characters in the password that are &quot;confusing&quot; the shell.
There are standard techniques for supplying passwords to mysql utilities that avoids having to have them coded into scripts or visible to any process list run on the machine.
See this answer.