PHP script to check TALL LOCK status in MySQL

I use mysqldump to backup MySQL.

mysqldump --lock-tables....

The database is about 2 GB, so mysqldump takes a lot of time. If anyone is trying to access the database during the backup, I would like to send a message stating that "the database backup is supported, please go back in 10 minutes"

My questions use a PHP script, how can I check if the mysql table is locked or not.

Thanks in advance.

Regards, Sanjay

+2
source share
2 answers

The preferred method would be to set up replication,
and mysqldump on the slave instead to master instead (assuming only the master serves the requests)

,

+2

/, php script, / , , MySQL , , , .

!

EDIT: MySQL GET_LOCK

+1

All Articles