1

I have a MySQL database that is about 17GB in size. Right now we don't have a backup for this and I have been tasked to look into backing it up automatically.

I am a software developer myself, not an expert database engineer.

After some research I found out that MySQL has something called MySQL Replication, which will automatically create a backup database on different server.

My concern about this is that if someone accidentally drops a table, or deletes a record, the same will happen on the slave database as well - so that would not serve as a backup.

I need suggestions on what can be done with our MySQL database so that it can be backed up automatically.

Vérace
31k9 gold badges73 silver badges86 bronze badges
asked Nov 23, 2019 at 9:53
4
  • After some research I found out that MySQL has something called MySQL Replication, which will automatically create a backup database on different server. :ROFL: Replication initiation needs in restoring full DB backup on slave server. Commented Nov 23, 2019 at 18:16
  • How complex is your DB structure? Commented Nov 23, 2019 at 18:17
  • See also LVM snapshots. Commented Nov 24, 2019 at 1:55
  • @Akinam I have about 80 tables in 2 databases to backup Commented Nov 25, 2019 at 6:56

1 Answer 1

1

Note that mysqlbackup is not a hot backup solution. For databases the size of your one, there really is no debate; see the related Q & A Mysql backup strategies?

As Shlomi Noach (GitHub's MySQL guy) says in his answer, Percona's XtraBackup is your go-to choice. It is also worth reading MySQL Backup and Restore Best Practices by Krzysztof Ksiazek.

By the way, no backup strategy on earth will protect you from devs/DBAs deleting records/dropping tables, that's why you should be using incremental backups; maybe LVM snapshots or flush logs. However, incremental backups are also performed by XtraBackup. See also Example Backup and Recovery Strategy in the MySQL reference manual.

On a more general note, broad approaches to this issue are discussed in:

In any case, on a production system, devs (or DBAs for that matter) should not be wandering through the filesystem and/or database deleting stuff ad libitum. Any and all changes on production should have been performed at least twice on test/UAT or similar systems before being implemented in prod! This is best practice.

answered Nov 23, 2019 at 11:39
5
  • Thank you for the information. It’s glad to be a member of such a great community. Will XtraBackup serve my purpose and do incremental backups? Also is it easy to implement for a non database expert like me ? Thanks Commented Nov 24, 2019 at 13:21
  • I have always found Percona's documentation to be excellent, and their lists are very helpful as well! There's always here also! If you found my answer good, you could always mark it as correct and/or helpful. Glad your first experience here has been positive! Commented Nov 24, 2019 at 14:23
  • I was reading the documentation for XtraBackup and it says that it doesnot support MYSQL versions less then 8.0. The version i am running right now is MySQL Version 5.6.43. What is your advise on this? Commented Nov 25, 2019 at 6:14
  • I was surprised about 5.6, so I checked. Percona is saying that 2.4 (latest version) supports MySQL the way back to version 5.1! Commented Nov 25, 2019 at 8:03
  • sorry I was looking at the version 8 of Percona. Commented Nov 26, 2019 at 10:07

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.