Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Export data with MySqlBackup Library rel. 2.3.6.2 and MySqlWorkBench ver. 8.0.26

MySqlWorkBench
- DataExport
- Export to Dump Project Folder
- Select single Table or all
- Include Create Schema
* Start export

ex: same table tb_foto over 18.000 record contain 
two Field TINYBLOB path and filename
field Blob -> image 103 x 100 pixel

result : from MySqlBackup ---- tb_foto.sql -> 104.576 Kb
         from MySqlWorkBench - tb_foto.sql ->  62.799 Kb

why this considerable difference of space between MySqlBackup and MySqlWorkBench


What I have tried:

MySqlBackup mb = new MySqlBackup(cmd);

private void BackupTabella(MySqlBackup mb,string path, string tabella, string tabellaSql)
        {                           
            mb.ExportInfo.AddCreateDatabase = true;        //schema db
            mb.ExportInfo.ExportTableStructure = true;     //table structure
            mb.ExportInfo.ExportRows = true;               //data table                     

            List<string> tbex = new List<string>();

            if (tabella != "")
            {
                tbex.Add(tabella);
            }

            string file = path + tabellaSql;

            int found = file.LastIndexOf("Storico");
            if (found > -1)
            {
                found = file.LastIndexOf(tabellaSql);
                if (found > -1)
                {
                    file = file.Substring(0, found) + "\\" + file.Substring(found);
                }
            }

            mb.ExportInfo.TablesToBeExportedList = tbex;   //elenco tabelle se vuoto = tutte
            mb.ExportInfo.GetTotalRowsMode = GetTotalRowsMethod.Skip;           
            mb.ExportToFile(file);
        }
Posted
Comments
Chris Copeland 13-Jan-22 6:32am    
If the files have difference sizes and contain the raw SQL that has been exported, have you tried opening the files and seeing what the difference is? Is one exporting CREATE statements while the other is only exporting data? If you actually look at the two files you should get a clearer picture of the difference between them.

You could also use a tool like WinMerge to compare the file contents.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900