1,查看所有数据库大小

use information_schema;
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES;

2,查看指定数据库大小

use information_schema;
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES where table_schema='dbname';

3,查看指定数据库中指定表的大小

use information_schema;

select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='dbname' and table_name='tbname';

4,查看日志文件位置

show variables like 'general_log_file';              日志文件路径

show variables like 'log_error';                         错误日志文件路径

show variables like 'slow_query_log_file';        慢查询日志文件路径

 

5,查询重复数据

select user ,count(user) as count from  dz_wx_users GROUP BY user  HAVING count(user) >1

 

select * from dz_wx_users where user in (select user from dz_wx_users GROUP BY user HAVING count(user) >1)

 

相关文章:

  • 2021-05-25
  • 2022-12-23
  • 2021-08-07
  • 2021-09-12
  • 2021-12-13
  • 2022-12-23
猜你喜欢
  • 2022-01-12
  • 2022-12-23
  • 2021-06-15
  • 2021-04-29
  • 2021-08-14
  • 2022-02-03
相关资源
相似解决方案