Dec 11, 2012 at 2:51 AM
Edited Dec 11, 2012 at 3:12 AM
The sql script file contains some illegal characters in between the hexadecimal string of the exported blob data. The characters should consists of 0-9 and A-F.
However, regarding the error of packets larger than max_allowed_packet are not allowed.
I am able to identify the cause of problem and fixed it. :)
max_allowed_packet defines the maximum length of single SQL query. Default value is 1 MB. If the query is larger than 1MB, exception will raise.
In previous version of MySqlBackup.NET, it does has modify max_allowed_packet to maximum of 1GB, the maximum length allowed by MySQL in single query.
It is modified by executing this SQL query:
SET GLOBAL max_allowed_packet = 1024*1024*1024;
But the problem is, the modified max_allowed_packet will only take effect on new connection, not current connection. Therefore, 1 more step has to be taken: after executing the above query, the connection should be reset (Close & Re-Open).
This is fixed in MySqlBackup 1.5.5 beta. You may want to review it.
I have tested it by inserting some files of 10MB into database and Backup & Restore it with MySqlBackup.NET 1.5.5. It does the job. The exported SQL file is about 90MB in size.
One more reminder, if the user used in the connection does not has the privilege to modify Global Variables (i.e. max_allowed_packet), MySqlBackup 1.5.5 will still raise the exception of packets larger than max_allowed_packet are not allowed.