查询数据锁
select COUNT(1) from performance_schema.data_locks;
select * from performance_schema.data_lock_waits;
show status like 'innodb_row_lock_%';删除指定日期以前的日志索引中binlog日志文件
purge master logs before '2023-11-21 00:00:00';删除指定日志文件的日志索引中binlog日志文件
purge master logs to'mysql-bin.000022';在binlog中查找指定信息
./mysqlbinlog --database=complaint-boot /www/server/data/mysql-bin.xxx|grep -B 4 x要查找的信息错误处理
mysqladmin flush-hosts
程序访问数据库时报错:
message from server: "Host '172.22.x.x' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'"来自服务器的消息:“主机‘172.22.x.x’由于许多连接错误而被阻止;使用‘mysqladmin flush-hosts’解除阻止”
需要登录到 MySQL 所在的服务器,执行命令mysqladmin -u root -p flush-hosts,之后输入管理员密码即可。