php mysql查询锁,PHP脚本检查MySQL表锁状态

I use mysqldump for MySQL Backup.

mysqldump --lock-tables....

The DB is about 2GB, hence mysqldump takes a long time.

If anyone tries to access the DB during backup, I would like to flash a message saying "the DB is being backed-up, please return back after 10 minutes"

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

Thank you in advance.

Best regards,

Sanjay

解决方案

Prefer method will be setup replication,

and mysqldump on the slave instead on master (assuming only master is serving requests)

So, you never experiencing downtime

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值