1

I'm trying to take a backup from my Mysql Server.

Is it a correct way to shut down the Mysql and copy all files from the directory"/var/lib/mysql" and paste them on another directory?

1
  • Is it a correct way No, this may result in both lost/damaged data and non-startable MySQL.
    – Akina
    Commented Jul 16, 2022 at 4:20

1 Answer 1

0

Since it is possible to clone a machine to make another working machine, what you describe is likely to work. However, two things are missing: The mysql code and the configuration file. The config may need to be edited for then machine.

There are several other ways to take a backup:

  • mysqldump (and variants: xtrabackup, mariadbaackup, etc)
  • lvm snapshot

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.