本文介绍了备份MySQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大约1.7GB的MySQL数据库.我通常使用mysqldump备份它,大约需要2分钟.但是,我想知道以下问题的答案:

I have a MySQL Database of about 1.7GB. I usually back it up using mysqldump and this takes about 2 minutes. However, I would like to know the answers to the following questions:

  1. mysqldump是否阻止对数据库的读取和/或写入操作?因为在实际情况下,我不想阻止用户在备份数据库时使用它.

  1. Does mysqldump block read and/or write operations to the database? Because in a live scenario, I would not want to block users from using the database while it is being backed up.

对于我来说,每周只备份一次整个数据库是一个理想的选择,但是在中间的几天中,只需要备份一个表,其他表则不会更改.有没有办法做到这一点?

It would be ideal for me to only backup the WHOLE database once in, say, a week, but in the intermediate days only one table needs to be backed up as the others won't change. Is there a way to achieve this?

出于这些目的,mysqlhotcopy是否是更好的选择?

Is mysqlhotcopy a better alternative for these purposes?

推荐答案

  1. 否,您可以使用--lock-tables指定要锁定的表,但默认情况下不是这样
  2. 如果未指定任何表,则将备份整个数据库,或者可以指定表列表:

  1. No, you can specify tables to be locked using --lock-tables but they aren't by default
  2. If you don't specify any tables then the whole DB is backed up, or you can specify a list of tables :

mysqldump [选项] db_name [表]

mysqldump [options] db_name [tables]

不好意思,但是我运行了许多MySQL数据库,有些更大,有些小于1.7gb,并且所有备份都使用mysqldump.

Not used it sorry, however I run a number of MySQL DBs, some bigger some smaller than 1.7gb and I use mysqldump for all my backups.

这篇关于备份MySQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 23:12