Home  >  Q&A  >  body text

mysql数据自动备份,大家一般怎么弄?

PHPzPHPz2742 days ago633

reply all(2)I'll reply

  • 黄舟

    黄舟2017-04-17 14:19:47

    How to prepare:

    1. Cold standby
      db shut down & cp data files (no one should use them now)

    2. Hot backup
      mysqldump (the most common), there are many tools, the subject can search.

    3. Create a slave and perform real-time backup through mysql synchronization mechanism. Of course, you can only have one backup.

    Where to backup:
    To prevent misoperation, you can backup it locally.
    To prevent the server from being bombed, you can back it up in the same computer room and in different machines
    To prevent the computer room from being bombed, you can back it up in different computer rooms in the same city
    In order to prevent large-scale disasters, remote computer room backup can be performed

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-17 14:19:47

    Use the mysqldump that comes with the client, write sh under Linux, use crontab, and write bat under windows to use the system scheduled task, and save it to the local specified directory.
    Or get an ftp and transfer it to other machines after exporting. Off-site backup is safer. There is the ftp command under cmd, and there are ftp and lftp under linuxshell, both of which can access ftp.
    The server I manage does this. I don’t know if there is any other better way.

    reply
    0
  • Cancelreply