查看缓存
show variables like '%query%';
Variable_name | Value |
---|---|
binlog_cache_size | 32768 |
binlog_stmt_cache_size | 32768 |
have_query_cache | YES |
host_cache_size | 279 |
innodb_disable_sort_file_cache | OFF |
innodb_ft_cache_size | 8000000 |
innodb_ft_result_cache_limit | 2000000000 |
innodb_ft_total_cache_size | 640000000 |
key_cache_age_threshold | 300 |
key_cache_block_size | 1024 |
key_cache_division_limit | 100 |
max_binlog_cache_size | 18446744073709547520 |
max_binlog_stmt_cache_size | 18446744073709547520 |
metadata_locks_cache_size | 1024 |
query_cache_limit | 1048576 |
query_cache_min_res_unit | 4096 |
query_cache_size | 16777216 |
query_cache_type | OFF |
query_cache_wlock_invalidate | OFF |
stored_program_cache | 256 |
table_definition_cache | 1400 |
table_open_cache | 2000 |
table_open_cache_instances | 16 |
thread_cache_size | 8 |
query_cache_size 查询缓存的大小
query_cache_type 查询缓存是否已开启
开启/关闭缓存
# 临时关闭,重启失效
set global query_cache_size=0
set global query_cache_type=0
# 永久关闭,进入配置文件并设置
query_cache_size=0
query_cache_type=0