MySQL Backup migration--mysqlbackup--(Unable to resolve view ungrateful error)

Source: Internet
Author: User

Here is the use of mysqlbackup, which can then be downloaded in NuGet.

Can not solve the problem of view ungrateful error, only the table with the data is appropriate, if there is a view embedded view, please refer to the MySQL backup migration--mysqldump (. NET call Mysqldump.exe mode)--(to resolve the view Embedded ungrateful error) http:/ Www.cnblogs.com/pbys/p/4142367.html

stringConstring ="server=192.168.0.1;port=3306;user=root; pwd=123456; database=test1;allow zero datetime = TRUE;"; stringFile ="C:\\backup.sql"; System.IO.MemoryStream Ms=NewSystem.IO.MemoryStream ();//how to export to memory            using(Mysqlconnection conn =Newmysqlconnection (constring)) {                using(Mysqlcommand cmd =NewMysqlcommand ()) {                    using(Mysqlbackup MB =Newmysqlbackup (CMD)) {cmd. Connection=Conn; Conn.                        Open (); //MB. Exportinfo.addcreatedatabase = true;//do you need to create a database//MB. exportinfo.exporttablestructure = true;//Export Table Structure//MB. Exportinfo.exportrows = true;//Export DataMb. Exportinfo.exportviews =false;//view does not guideMb.Command.CommandTimeout = -; Mb. Exporttofile (file); // How to export to a file                          //MB. Exporttomemorystream (MS);//how to export to memoryConn.                    Close (); } }} constring="server=192.168.0.2;port=3306;user=root; pwd=123456; database=test1;allow zero datetime = TRUE;"; using(Mysqlconnection conn =Newmysqlconnection (constring)) {                using(Mysqlcommand cmd =NewMysqlcommand ()) {                    using(Mysqlbackup MB =Newmysqlbackup (CMD)) {cmd. Connection=Conn; Conn.                        Open (); //MB.                        Importinfo.targetdatabase = "Test2"; //MB. Importinfo.databasedefaultcharset = "UTF8";Mb.Command.CommandTimeout = -;MB. ImportFromFile (file); // How to export to a file                          //MB. Importfrommemorystream (MS);//how to export to memoryConn.                    Close (); }                }            }


For more parameters and updates, please refer to Http://www.codeproject.com/Articles/256466/MySqlBackup-NET

MySQL Backup migration--mysqlbackup--(Unable to resolve view ungrateful error)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.