View Single Post
Tuổi 07-09-2011, 03:59 PM   #1
hoctinhoc
Guest
 
Trả Lời: n/a
Tối ưu MySQL - MySQL Tweaking
MySQL Tweaking – Tối ưu MySQL



Với cPanel or Plesk hay cài đặt MySQL bình thường bao giờ sau khi cài xong MySQL cũng chạy với những config mặc định. Nó không tối ưu và tốt cho server. Đặc biệt là với hosting provider.
Đây là cấu hình tốt cho MySQL.

Sửa file /etc/my.cnf Xóa hết nội dung đã có, thay thành:
Mã:
[mysqld]
max_connections=900
max_user_connections=50
skip-locking
skip-innodb
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
interactive_timeout=50
wait_timeout=50
connect_timeout=10
thread_cache_size=128
key_buffer=256M
max_allowed_packet=16M
table_cache=1024
join_buffer=1M
sort_buffer_size=1M
read_buffer_size=1M
max_connect_errors=10
thread_concurrency=4
myisam_sort_buffer_size=64M
log-bin
server-id=1
 [safe_mysqld]
open_files_limit=8192
 [mysqldump]
quick
max_allowed_packet=16M
 [mysql]
no-auto-rehash
[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M
 [myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M
 [mysqlhotcopy]
interactive-timeout 

Chuc cac ban thanh cong!





  Trả lời ngay kèm theo trích dẫn này