-
- [mysqld]
- port = 3306
- socket = /tmp/mysql.sock
- skip-locking
- key_buffer = 160M
- max_allowed_packet = 1M
- table_cache = 64
- sort_buffer_size = 512K
- net_buffer_length = 8K
- read_buffer_size = 256K
- read_rnd_buffer_size = 512K
- myisam_sort_buffer_size = 8M
- max_connections=1000
复制代码
当然,你还需要养成良好的编程习惯,做到资源的合理使用与回收,这样你的php程序才会更效,才会减少too many connections这样的错误发生。
|