I am trying to backup MySQL database but if the command run outside of the application manually it works fine but if it's executed from within the application it gives the error "using password on the command line interface can be insecure" and nothing happens but as I said it I run same command through cmd or a .bat file it work properly, so how to fix it ? and here is the code I am trying
Private Sub BACKUP_BTN_Click(sender As Object, e As EventArgs) Handles BACKUP_BTN.Click
Using myProcess As New Process()
Dim newfiledb As String = Application.StartupPath & "\" & Format(Now(), "MMM_dd_yyyy@h~mm_tt").ToString & "_local.sql"
Try
myProcess.StartInfo.FileName = Application.StartupPath & "\mysql-8.0\bin\mysqldump.exe"
myProcess.StartInfo.WorkingDirectory = Application.StartupPath
myProcess.StartInfo.Arguments = "--host=localhost --user=****--password=*****-R airtech_db > " & Application.StartupPath & "\filename.sql"
'myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
myProcess.Start()
myProcess.WaitForExit()
Label1.Text = " MsgBox(Backup Created ... & vbNewLine & newfiledb)"
Catch ex As Exception
MsgBox(ex.Message, vbCritical + vbOKOnly, ex.Message)
Finally
myProcess.Close()
End Try
End Using
I alternately already tried this as well gives the same error
Process.Start(--host=localhost --user=****--password=****-R airtech_db > " & Application.StartupPath & "\adil.sql)