平时的笔记
程序员文章站
2022-05-10 19:31:59
...
1、MySQL二进制日志和主从快速设置
binlog_format=ROW
binlog_row_image=minimal
plugin-load = semisync _master.so
2、Linux快速全局查找大于指定大小的文件
find / -xdev -size +100M -exec ls -l {} \;
3、MySQL查找重复数据和去重
查找重复IMEI的记录
SELECT *
FROM device
GROUP BY imei
HAVING COUNT(imei) > 1;
删除重复的IMEI中id大的记录
DELETE FROM device
WHERE id NOT IN
(
SELECT a.id FROM
(
SELECT MIN(id) id
FROM device
GROUP BY imei
) a
)