首先确认innodb_fast_shutdown的参数值为1
mysql> show global variables like ‘%innodb_fast_shutdown%’;
±---------------------±------+
| Variable_name | Value |
±---------------------±------+
| innodb_fast_shutdown | 1 |
±---------------------±------+
1 row in set (0.00 sec)
第二步在innodb的配置文件/etc/my.cnf中添加两行
innodb_log_file_size=2147483648
innodb_log_files_in_group=5
第三步重启mysqld service
service mysqld restart
第四步验证修改是否生效
查看全局参数
mysql> show global variables like ‘%innodb_log%’;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect…
Connection id: 7
Current database: sampdb
±----------------------------±-----------+
| Variable_name | Value |
±----------------------------±-----------+
| innodb_log_buffer_size | 104857600 |
| innodb_log_checksums | ON |
| innodb_log_compressed_pages | ON |
| innodb_log_file_size | 2147483648 |
| innodb_log_files_in_group | 5 |
| innodb_log_group_home_dir | ./ |
| innodb_log_write_ahead_size | 8192 |
±----------------------------±-----------+
7 rows in set (0.02 sec)
从操作系统中验证
[root@rws1270149 data]# ls -al ib_logfile*
-rw-r----- 1 mysql mysql 2147483648 May 2 16:02 ib_logfile0
-rw-r----- 1 mysql mysql 2147483648 May 2 16:01 ib_logfile1
-rw-r----- 1 mysql mysql 2147483648 May 2 16:01 ib_logfile2
-rw-r----- 1 mysql mysql 2147483648 May 2 16:01 ib_logfile3
-rw-r----- 1 mysql mysql 2147483648 May 2 16:01 ib_logfile4