1.MySQL查詢各個表的數據量
use information_schema;
select table_name,table_rows from tables
where TABLE_SCHEMA = '數據庫名字'
order by table_rows desc;
2.查看內存緩存使用情況
SHOW GLOBAL STATUS LIKE 'innodb_buffer_pool_pages_%';
3.MySQL數據庫優化建議
1) 數據庫最大連接調到1000
2) innodb_buffer_pool_size=4G
3) innodb_flush_log_at_trx_commit=0
4) innodb_log_file_size=1000M
4.MySQL複製表操作
create table bi_core_order201811 as select * from 表名 where 查詢條件
5.MySQL查看連接使用情況
show status like 'Threads%';
show global status like 'Max_used_connections';
show variables like '%max_connections%';
5.MySQL事件開啓狀態
show variables like 'event_scheduler';
6.顯示當前SQL進程
show processlist
7.顯示開啓MySQL查詢慢日誌功能
set global slow_query_log = on;
set global log_output = file;
set long_query_time = 1;
show variables like '%quer%';