How to set default innodb_buffer_pool_size before mysqldump and set it back to 1600M after mysqldump? I want to make backups every day automatically. It was fine when database was 700-800Mb, but now database (dumped sql file) is 1.5G and when using mysqldump it errors on random table with 2013 error.

When I comment out my setting of innodb_buffer_pool_size, mysqldump works perfectly.

Is there nice way to set to defaults innodb_buffer_pool_size before mysqldump and then back to 1600M?



p.s. I'm using mysqldump as following

mysqldump --max_allowed_packet=500M --net_buffer_length=548576 --single-transaction?
90% is dangerously high for any server.  For a &quot;tiny&quot; 2G, a much lower 500M should be safe.  Swapping is terrible for performance.  But, things are worse -- --max_allowed_packet=500M is taking up a terribly large amount of RAM.  Try 50M.  If that gives an error, then raise it and lower the buffer_pool.