Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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?
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
mysqldump -u root --password=YOUR_PASSWORD mydb > dump.sql
Add a comment
Required, but never shown
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.
Explore related questions
See similar questions with these tags.