# Regarding Backup

**URL:** <https://forums.percona.com/t/regarding-backup/21015>\
**Category:** MySQL & MariaDB\
**Created:** [March 29, 2023, 6:58am UTC](https://forums.percona.com/t/regarding-backup/21015 "2023-03-29T06:58:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andre1976](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@Andre1976](https://forums.percona.com/u/Andre1976)\
**Post date:** [March 29, 2023, 6:58am UTC](https://forums.percona.com/t/regarding-backup/21015/1 "2023-03-29T06:58:50Z")

</div>

Hello Guys

Please , Can you advice me the best approach for 2 things ?

1 ) mysqldump and mysqlbackup : What is the best option to schedule it using cron without password exposition ?

1. I have a database handling stream solution. Basically I have a table with huge transactions with a lot of Inserts and deletes . Can you support me how can I perform a analyze , optimize in this tables without long locks ? I think in mysqlcheck, however I am not sure about it

Version OS : Red Hat 7 and mysql 5.7 ( I am aware that it is out of date )

Regards  
Andre

---

<div class="post-metadata">

**Author:** ![Ivan\_Groenewold](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_groenewold/32/6299_2.png) [@Ivan\_Groenewold](https://forums.percona.com/u/Ivan_Groenewold)\
**Post date:** [March 29, 2023, 11:14am UTC](https://forums.percona.com/t/regarding-backup/21015/2 "2023-03-29T11:14:34Z")

</div>

Hi Andre, instead of mysqldump I suggest you use mydumper, which can work in parallel so is much faster: [GitHub - mydumper/mydumper: Official MyDumper project](https://github.com/mydumper/mydumper)

You can create a defaults file (e.g. .mylogin.cnf) and then have mydumper use it, that way you avoid putting the password inside the cron file.

For your second question, you can do analyze with only a quick lock, but if you need to optimize and rebuild the table, you’ll have to do it with pt-online-schema-change to avoid problems. Another alternative is to perform the procedure on a read replica, then promote it as primary.

Hope that helps

---

<div class="post-metadata">

**Author:** ![Andre1976](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@Andre1976](https://forums.percona.com/u/Andre1976)\
**Post date:** [March 29, 2023, 7:22pm UTC](https://forums.percona.com/t/regarding-backup/21015/3 "2023-03-29T19:22:49Z")

</div>

Thanks Ivan! I wll try this one.

Regards  
Andre
