MySQL Dump using query
I want to dump my DB with a click on a button in my C#.Net App. I thought about usi开发者_开发知识库ng
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 -u root --password=YOUR_PASSWORD mydb > dump.sql
精彩评论