美文网首页
2021-03-02 MediaWiki MySQL数据库备份及

2021-03-02 MediaWiki MySQL数据库备份及

作者: AK蜗牛 | 来源:发表于2021-03-02 09:54 被阅读0次

    MySQL
    Automysqlbackup
    查看软件包

    root@XXX:~# apt show automysqlbackup
    Package: automysqlbackup
    Version: 2.6+debian.4-3
    Priority: extra
    Section: universe/admin
    Origin: Ubuntu
    Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
    Original-Maintainer: Thomas Goirand <zigo@debian.org>
    Bugs: https://bugs.launchpad.net/ubuntu/+filebug
    Installed-Size: 58.4 kB
    Depends: bsd-mailx | mailx, default-mysql-client | virtual-mysql-client
    Recommends: mutt
    Homepage: http://sourceforge.net/projects/automysqlbackup/
    Download-Size: 14.4 kB
    APT-Sources: http://us.archive.ubuntu.com/ubuntu groovy/universe amd64 Packages
    Description: daily, weekly and monthly backup for your MySQL database
     automysqlbackup creates backup every day, week and month for all of your MySQL
     database, to a configured folder. There's nothing to do but to install this
     package, and you'll rest assured that you have a way to go back in the history
     of your database.
     .
     This package may be unsafe if untrusted users may create databases and if no
     check on the syntax of the name of them is performed.
    

    安装:

    # apt install automysqlbackup
    

    数据库都将被保存在/var/lib/automysqlbackup/:

    root@vultr:~# find /var/lib/automysqlbackup/
    /var/lib/automysqlbackup/
    /var/lib/automysqlbackup/monthly
    /var/lib/automysqlbackup/daily
    /var/lib/automysqlbackup/daily/wikidb
    /var/lib/automysqlbackup/daily/wikidb/wikidb_2021-03-02_01h49m.Tuesday.sql.gz
    /var/lib/automysqlbackup/weekly
    /var/lib/automysqlbackup/weekly/wikidb
    

    手动备份:

    # automysqlbackup
    

    恢复数据库:

    gunzip < /var/lib/automysqlbackup/weekly/my_wiki//var/lib/automysqlbackup/daily/wikidb/wikidb_2021-03-02_01h49m.Tuesday.sql.gz|mysql -uUSER -pPASSWORD my_wiki
    

    相关文章

      网友评论

          本文标题:2021-03-02 MediaWiki MySQL数据库备份及

          本文链接:https://www.haomeiwen.com/subject/ftjtqltx.html