How to hot backup (online backup) on a Slackware 14.2 with MariaDB 10.0.37?

71 Views Asked by At

I'm trying mysqldump right now with the following script, but I need to verify that there are no locks in the process. What could I add to the code to confirm whether or not there are locks?

Script input_mysql_bash_usuario.sh:

#!/bin/bash
i=1
# serão inseridos um milhão de dados
while [ $i -le 1000000 ]
do
    mysql -uroot -pzabbix -e \
    “INSERT INTO usuario(nome,telefone,email,aniversario) VALUES(‘cesar,’9999999’,’[email protected]’,’1993-11-18’) mysql_bash
    i=$(( i +1 ))
done

shell> nohup ./input_mysql_bash_usuario.sh > ./saida.log &

mysqldump --u<user> -p<password> <database> --single-transaction | gzip -c  | cat > $(date +%Y-%m-%d-%H.%M.%S).sql.gz

I've tried before Percona XtraBackups 2.1.5, the package available in SlackBuils, but there were a lot of errors, I also saw that there is the Maria Backup, but it does not have on the MariaDb 10.0.37, which is from Slackware.

1

There are 1 best solutions below

0
Rick James On
BEGIN;
SELECT * FROM mysql_bash.usuario LIMIT 1 FOR UPDATE;
SELECT SLEEP(3600);  -- one hour; adjust as needed
COMMIT;

That might do the opposite of what you want -- namely verify that the dump can run even though you have a lock.