Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when trying to back up tables with more than 2GB #110

Closed
adrbarros opened this issue Sep 9, 2023 · 8 comments
Closed

Exception when trying to back up tables with more than 2GB #110

adrbarros opened this issue Sep 9, 2023 · 8 comments

Comments

@adrbarros
Copy link

Hello.

I have a database running since 2008, some tables are very large, between 2 to 4.5 GB and the total database has 19GB, is currently in a Server Linux Centos 8 32GB RAM, the MySQL versions have been evolving and being migrated with Over the years, starting in version 5.1 and currently in version 8.

Using the library, when backing up the database, when it starts backing up the larger tables occurs Timeout errors, it is not always in the same table. I've increased the timeout and yet persists in these mistakes.

Does anyone have any tips, not to happen this kind of exception when performing the backup using the library?

Note: Backup via command line, it works perfectly.
Example of the command used via command line:
mysqldump -u USET -pPASS DATABASE - -adddrop -database - -adddrop -table -x -a -e -k -r -b> directory\backup_database_yyymddhmmm.sql

@adriancs2
Copy link
Member

Have you tried the connection string option of ConnectionTimeout

Server=yourserver;Database=yourdatabase;User ID=youruserid;Password=yourpassword;ConnectionTimeout=60;

@adriancs2
Copy link
Member

adriancs2 commented Sep 11, 2023

Where did you execute mysqldump and mysqlbackup.net?
Were they run on the same machine as the MySQL server?
Try running mysqlbackup.net on the same machine as the MySQL server.
If you are running mysqlbackup.net on a different machine, try to ensure the stability of the connection between both machines (the MySQL server and the machine that runs mysqlbackup.net).

@adrbarros
Copy link
Author

Backup or executed with MySQLBackup.net, I already set up the Timeout on the connection string, and using MySQLBackup.net happens the exception (error when backing on tables with over 2GB)

Scenario:
MySQL server is a centos 8 with 32GB RAM

Backup application is on a Windows 2019 server, developed in .net Windows Forms

@adriancs2
Copy link
Member

adriancs2 commented Sep 11, 2023

Which section raised the timeout exception? Do you have a screenshot of the error? Can you post the full error message?

If the timeout is raised by the WinForms UI operation, then you can use a background worker to run MySQLBackup.net on a separate thread. Then, you can execute MySQLBackup.net for as long as you need.

*Just a side note, MySqlBackup.NET can run on CentOS, if you wish to. You can read my blog for instructions of running MySqlBackup.net on CentOS: https://adriancs.com/c-sharp-mysql/332/run-mysqlbackup-net-on-centos/

@adrbarros
Copy link
Author

The Connection Timeout I already define at 60, 6000, 60000, 600000
My application is performed in backgroud, but always generates the same error.

Now I tested with the test solution that is in Github, and also the same error.

image

@adriancs2
Copy link
Member

I see, can you try again with MySqlConnector instead:
https://www.nuget.org/packages/MySqlBackup.NET.MySqlConnector/

you can write a simple small app just for this testing

@adriancs2
Copy link
Member

If you using the demo test app from github, you may use the function of "Progress Report - Export":

This function is run by using Background Worker, which runs MySqlBackup.net in a separate thread.

MySqlBackup Test App - Progress Report Export

@adrbarros
Copy link
Author

Using the 2 (mysql.data or mysqlconnector) connectors, it fires the same exception.

I will perform other tests, because with mysqlconnector the exception occurred in the last table that contains a lot of data, in this case I think increasing the timeout can resolve

Thank you for your help.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants