MySQL 默认引擎是myisam 引擎,有时我们会需要使用innodb引擎,只需要修改一下配置文件 my.cnf 即可。在 [mysqld] 段中加入如下配置信息default-storage-engine=Innodbinnodb_data_home_dir = /usr/local/mysql/var ## 即 datadirinnodb_data_file_path = ibdata1:2000M;ibdata2:2000M;ibdata3:2000M;ibdata4:2000M;ibdata5:2000M;ibdata6:100M:autoextendinnodb_log_group_home_dir = /usr/local/mysql/var ## 日志的目录,建议和 datadir 一样innodb_log_arch_dir = /usr/local/mysql/var ## 归档日志目录,建议同上innodb_table_locks=0innodb_buffer_pool_size = 3G ## 可以把这个值设为内存的70%-80%innodb_additional_mem_pool_size = 16Minnodb_log_file_size = 100Minnodb_log_buffer_size = 8Minnodb_flush_method = O_DIRECTinnodb_flush_log_at_trx_commit = 0