K
K
Kirill Gerasenkov2014-11-11 15:37:33
MySQL
Kirill Gerasenkov, 2014-11-11 15:37:33

Why does mysqldump hang the database?

Good afternoon, gurus and bearded men.
there is a little script:

echo "[--------------------------------[`date +%F--%H-%M`]--------------------------------]"
echo "[----------][`date +%F--%H-%M`] Run the backup script..."
mkdir $DATADIR/$PREFIX 2> /dev/null
echo "[++--------][`date +%F--%H-%M`] Generate a database backup..."
#MySQL dump
mysqldump --user=$USER --host=$HOST --password=$PASSWD --default-character-set=$CHARSET $DBNAME > $DATADIR/$PREFIX/$DBFILENAME-$
if ;then
echo "[++--------][`date +%F--%H-%M`] Aborted. Generate database backup failed."
exit 1
fi
echo "[++++------][`date +%F--%H-%M`] Backup database [$DBNAME] - successfull."
exit 0


При выполнение данного дампа база виснет и к сайту нет доступа, то есть база не падает, она как бы доступна, но сайт выдает ошибку коннекта к БД.
после выполнения дампа база оживает и сайт продолжает работу.


Server version: 10.0.14-MariaDB MariaDB Server

может я не знаю каких-то тонкостей с MariaDB? С MySQL таких проблем не было.....

help me, niggaz

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anatoly Scherbakov, 2014-11-11
@m000dy

I met this problem on MySQL. During the backup of a rather large database (unarchived SQL occupied hundreds of megabytes), normal work with it became impossible. Bypassed using Percona Xtrabackup, during which the load is not noticeable at all.
Judging by the first link in Google, it supports MariaDB.

V
Vladimir, 2014-11-11
@rostel

if the tables in innodb are converted, there will be no blocking

K
Kirill Gerasenkov, 2014-11-12
@m000dy

Thanks to everyone for the answers, I decided to look towards Percona Xtrabackup.
It's just that the possible logical inconsistency of the data when using --single-transaction is just annoying.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question