0

I want to dump my DB with a click on a button in my C#.Net App. I thought about using

Process.Start(@"mysqldump", @"-u root -p mydb > dump.sql");

but this command opens a command prompt asking for the MySQL user password.

how can I avoid this?

1 Answer 1

1

Instead of this command :

mysql -u root -p mydb > dump.sql

Try using this, passing the password in the command, so mysqldump doesn't ask for it :

mysqldump -u root --password=YOUR_PASSWORD mydb > dump.sql
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.