優化MySQL的在innodb資料效能 2017-01-10
我所使用的是WAMP,
wamp\bin\mysql\mysql當前版本\my.ini
步驟一
# Uncomment the following if you are using InnoDB tables
innodb_data_home_dir = c:/wamp/bin/mysql/mysql5.5.24/data/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = c:/wamp/bin/mysql/mysql5.5.24/data/
#innodb_log_arch_dir = c:/wamp/bin/mysql/mysql5.5.24/data/ #這行請勿註記打開,會有error
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 2048M #數值請調大(獨立主機的話可設定為實體記憶體的60%)
innodb_additional_mem_pool_size = 512M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 512M #數值請調大(設定為buffer_pool_size的1/4)
innodb_log_buffer_size = 128M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
關閉掉WAMP後,
刪除掉wamp\bin\mysql\mysql當前版本\data\底下的ib_logfile0、ib_logfile1
然後重開即可.