D
D
Dmitry Morozov2016-03-23 09:11:51
MySQL
Dmitry Morozov, 2016-03-23 09:11:51

MySQL in RAM. How to make a backup?

Good afternoon.
The administrator moved the database to the RAM. And I wrote a database backup script every 2 hours.

#!/bin/bash
/etc/init.d/mysqld stop
cd /var/mysql
rsync -arvv * /var/lib/mysql
/etc/init.d/mysqld start


It seems to me that stopping the base every two hours is not an option. Are there other ways?

From what I googled: mylvmbackup, mysqlhotcopy

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
OnYourLips, 2016-03-23
@OnYourLips

It seems to me that stopping the base every two hours is not an option.
Depends on reliability and uptime requirements.
But the way is, of course, strange.
Are there other ways?
Make a backup from the slave.

P
Puma Thailand, 2016-03-23
@opium

and why mysqldump does not suit you?
well, ssd is a little simpler and more reliable than RAM

L
landergate, 2016-06-21
@landergate

You don't need to stop MySQL at all .
Backup options without stopping the server:

  • mysqdump - takes a logical data dump, but see the pitfalls about table locking and consistency...
  • xtrabackup (using innobackupex) - takes a physical copy of InnoDB databases without stopping the application/database server. Does something similar to your script, but more advanced and without stopping the service.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question