用brew 安装mysql后,发现内存占用高达400M+,对于平时很少用mysql的我来说,简直是浪费。。。

sudo vim /etc/my.cnf

 

然后把下面的设置贴进去

  [mysqld] max_connections = 10

key_buffer_size = 16K max_allowed_packet = 1M table_open_cache = 4 sort_buffer_size = 64K read_buffer_size = 256K read_rnd_buffer_size = 256K net_buffer_length = 2K

thread_stack = 128K

重启mysql,内存占用降到了70M