Backing up Database in MySQL using C#

前端 未结 6 1236
有刺的猬
有刺的猬 2020-12-14 04:06

I created a Winforms in order to backup my Database. Then When I run my program it gives an Win32Exception was unhandled. \"The system cannot find the file specified\" Altho

6条回答
  •  悲哀的现实
    2020-12-14 04:50

    I believe you have to mention the user, pwd, db name and the target path..

    string path = @"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqldump.exe -u " + txtBoxDBUsername.Text + @" -p " + txtBoxDBName.Text + @" > " + txtBoxDBName.Text + @".sql"; 
    

    backup: # mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql

    restore:# mysql -u root -p[root_password] [database_name] < dumpfilename.sql

    http://www.thegeekstuff.com/2008/09/backup-and-restore-mysql-database-using-mysqldump/

提交回复
热议问题