mysql 找出重复数据
发表于|更新于|mysql
1 | SELECT * , count(openid) as count FROM `cul_logindata` GROUP BY `openid` HAVING count>1 |
文章作者: developer
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Dev!
相关推荐
2020-04-13
mysql 管理
创建数据库1CREATE DATABASE IF NOT EXISTS yourdbname DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_general_ci; 创建用户1create user 'user'@'%' identified by '123'; 授权用户1grant all privileges on db.* to 'user'@'%'; 查看用户1show grants for 'user'@'%'; 修改密码123use mysql; update user set password=password('123') where user='root' and host='localhost'; flush privileges; mysql8密码问题1ALTER USER 'native'@&...
2026-02-19
mysql使用记录
mysql查看binlog文件列表1SHOW BINARY LOGS; 清理binlog1PURGE BINARY LOGS BEFORE NOW(); 设置日志时间12SHOW VARIABLES LIKE 'expire_logs_days';SET GLOBAL expire_logs_days = 7;
2019-05-05
mysql ibdata1 文件过大
https://www.cnblogs.com/flish/p/5537679.htmlhttps://www.linuxidc.com/Linux/2018-01/150318.htmhttps://blog.csdn.net/demonson/article/details/80652945 在mysqld配置项目中 1innodb_file_per_table = 1 先备份数据库,然后停止数据库,删除ibdata1和ib_logfile开头的日志文件再重新导入数据库即可 可通过在/etc/my.cnf中添加 1innodb_force_recovery = 4 让表变为只读表
2019-03-19
mysql 统计重复记录数量
123456SELECT COUNT(*) as total FROM ( SELECT count(openid) as t FROM user GROUP BY `openid` HAVING t > 1 limit 1000) as a 如果下面写法会很慢 123456SELECT COUNT(*) as total FROM form_user WHERE id IN( SELECT count(id) FROM form_user GROUP BY `openid` HAVING COUNT(openid) > 1 limit 1000)
2019-01-22
mysql 数据库 升级
本机把mysql5.5升级到mysql8.0记录 备份数据在mysql5.5执行mysqldump 1mysqldump -u root -pPASSWORD --all-databases > ./all.sql 停止mysql5 安装mysql8,导入数据 12mysql -uroot -p rootsource ./all.sql 启动mysql8 升级不兼容表 1mysql_upgrade -u root -p
2018-01-24
redis mysql 性能记录 读写速度 windows linux
thinkphp5.0.10运行时间记录 centos7.2 腾讯云 1核1G 高效云盘 逐个写入redis lpush 100000条 3.381005smysql insert 100000条 23.706291s 获取最后redis rpop 0.001823smysql order|limit 0.003046s 索引查找redis lindex 0.001536smysql id 0.002653S windows10 2核4G SSD 逐个写入redis lpush 10000 12.013191smysql insert 10000 41.127062s 获取最后redis rpop 0.054366smysql order|limit 0.066480s 索引查找redis lindex 0.054666smysql id 0.069864s
公告
This is my Blog