##MySQL 最大可使用内存( M ): 

 
SELECT 
  (
    @@key_buffer_size + @@innodb_buffer_pool_size + @@query_cache_size + @@tmp_table_size + @@max_connections * (
      @@read_buffer_size + @@read_rnd_buffer_size + @@sort_buffer_size + @@join_buffer_size + @@binlog_cache_size + @@thread_stack
    )
  ) / 1024 / 1024 AS result 
  
 ##MySQL 单个连接最大可使用内存( M ): 
   
  SELECT 
    (
      @@read_buffer_size + @@read_rnd_buffer_size + @@sort_buffer_size + @@join_buffer_size + @@binlog_cache_size + @@thread_stack
    ) / 1024 / 1024 AS result 
 
##MySQL 最大可使用内存(不包含连接占用内存)( M ): 
 
    SELECT 
      (
        @@key_buffer_size + @@innodb_buffer_pool_size + @@query_cache_size + @@tmp_table_size
      ) / 1024 / 1024 AS result

相关文章:

  • 2021-04-29
  • 2021-06-01
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2021-12-05
猜你喜欢
  • 2022-12-23
  • 2022-03-02
  • 2022-12-23
  • 2021-12-17
相关资源
相似解决方案