MySqlBackupNET/MySqlBackup.Net

Fatal error encountered during command execution

SpaceInvader0 opened this issue · 4 comments

Hi, i am using MySqlBackup.NET, and during import i am getting the following error.
Any suggestion or similar situation encountered?

Message: Fatal error encountered during command execution.
StackTrace: at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
at MySql.Data.MySqlClient.MySqlScript.Execute()
at MySql.Data.MySqlClient.MySqlBackup.Import_AppendLineAndExecute(String line)
at MySql.Data.MySqlClient.MySqlBackup.Import_ProcessLine(String line)
at MySql.Data.MySqlClient.MySqlBackup.Import_Start()
at MySql.Data.MySqlClient.MySqlBackup.ImportFromTextReaderStream(TextReader tr, FileInfo fileInfo)
at MySql.Data.MySqlClient.MySqlBackup.ImportFromFile(String filePath)
at DatabaseBackUp.Program.ImportDatabase(String IPAddress, String DBName, Int32 Type, String Port) in Program.cs:line 1203
Source: MySql.Data
TargetSite: MySql.Data.MySqlClient.MySqlDataReader ExecuteReader(System.Data.CommandBehavior)

My code as follows.

using (MySqlBackup mb = new MySqlBackup(cmd))
                        {
                            cmd.Connection = conn;
                            //cmd.CommandTimeout = 0;
                            cmd.CommandTimeout = 1200;
                            conn.Open();
                            mb.ImportFromFile(file);
                            conn.Close();
                            SuccessFlag = true; 
                        }

Connection String
string constring = "SERVER=" + IPAddress + "; DATABASE=" + DBName + ";Port=" + Port + ";USER=123;PASSWORD=xxx;Convert Zero Datetime=True;Charset=utf8;";

This error is mostly related to parameters issue. Anyway, there is a problem with your dump file. You might want to check it out. You can also try out stackoverflow.com, you might find some useful info there.

There is also a possibility that you export the original dump file which contains Unicode characters but written to a incompatible file encoding format.

Hi Adrian, sorry for the late reply. is there a limitation in terms of the number of records/or size of SQL dump i can import using the dll? Could it be because my SQL dump is too big (7gb++)? Reason for asking is because my table has 70000+ records, for debugging purpose i split the table in 2 and it is able to import successfully. The fatal error occurs only when i try to import 70000 records at one go.

Hi, @SpaceInvader0 , there is no limit on rows of file size.

Hi adriancs2, noted and thanks!