As I understand it, the single-transaction key when creating a database backup in MySQL does not lock the tables. Keyless locks.

Those. if you execute the command for a 3GB database, then everything is blocked for 5 minutes. No user can read or write to the database any lines. Those. site for 5 minutes simply lay down:

mysqldump -u root -psdfihebjdf mysite_db > /tmp/db-backup.sql 

So which single-transaction is not used by default?) Why did you come up with this key? What is the difference with him and without him? In which cases we need to block the tables of the mind I will not attach.

  • one
    For InnoDB tables you need to add - single-transaction, this ensures the integrity of the backup data. This is not relevant for MyISAN tables, because they do not support transactionalities. habrahabr.ru/post/105954 Read here, too, mysql.ru/docs/man/mysqldump.html - Vanya Avchyan
  • Please read carefully what I wrote. - Jenkamen
  • What version of MySQL do you have? - Vanya Avchyan
  • one
    Imagine that you have money written to a client’s account in one table, and the current state of the account is recorded in another table, i.e. The amount that was recorded in the "receipts" is added to the current balance. Consistent state is when information is reflected either in both tables or in none of them. If the receipt unloads the dump, but the old state of the account (the state will be unloaded earlier) then when you load the dump you will have problems, the client will not be enough money - Mike
  • one
    --quick, -q This option is useful for dumping large tables. buffers data into memory before writing it. dev.mysql.com/doc/refman/5.7/en/… - Vanya Avchyan

0