开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜