title: Packets larger than max_allowed_packet not allowed
body: <p>I'm using an import command to import MySQL data. I get an error "Packets larger than max_allowed_packet not allowed", but if I immediately rerun the command, it works. You can see I tried closing and opening the connection between commands, that didn't make a difference. Is there some way around this error? </p>
  
  <pre><code> cmd.Connection = conn;
   conn.Open();
  
   cmd.CommandText = "SET GLOBAL  max_allowed_packet=1024*1024*1024;";
   cmd.ExecuteNonQuery();
   //conn.Close();
   //conn.Open();
  
   mb.ImportFromFile(file); //Imports a large sql file
   conn.Close();
  </code></pre>