您好,登錄后才能下訂單哦!
本篇文章為大家展示了MYSQL中怎么調整日志組,內容簡明扼要并且容易理解,絕對能使你眼前一亮,通過這篇文章的詳細介紹希望你能有所收獲。
1、查看關閉方式:
mysql> show variables like '%fast%';
+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| innodb_fast_shutdown | 1 |
+----------------------+-------+
1 row in set (0.00 sec)
該參數解釋如下:,默認值為1,設置為0 是干凈的關閉 和ORACLE里面shutdown immeidate對應
The InnoDB shutdown mode. If the value is 0, InnoDB does a slow shutdown, a full purge and a change buffer merge before shutting down. If the value is 1 (the default), InnoDB skips these operations at shutdown, a process known as a fast shutdown. If the value is 2, InnoDB flushes its logs and shuts down cold, as if MySQL had crashed; no committed transactions are lost, but the crash recovery operation makes the next startup take longer.。
2、調整參數innodb_fast_shutdown為0
set global innodb_fast_shutdown=0
3、關閉MYSQL
mysqladmin -uroot shutdown -S /home/mysql-5.6/mysql-3306/mysql.sock
4、調整REDO大小,日志文件默認命名是ib_logfile開頭
1、找到REDO文件所在目錄(有幾個文件處理幾個,移動到其他目錄)。
mv ib_logfilexx ../ ib_logfilexx
2、添加參數:日志組個數和日志大小到參數文件
在參數文件[mysqld]下面添加如下參數
innodb_log_file_size = 512M –每個日志組大小512M
innodb_log_files_in_group = 3—一共3組日志組
5、 打開mysql
./mysqld_safe --defaults-file=/home/mysql-5.6/mysql-3307/my.cnf &
6、查看修改后的日志組大小和個數
mysql> show variables like '%log_file%';
+---------------------------+------------------------------------------------+
| Variable_name | Value |
+---------------------------+------------------------------------------------+
| general_log_file | /home/mysql-5.6/mysql-3306/data/test1.log |
| innodb_log_file_size | 536870912 |
| innodb_log_files_in_group | 3 |
| slow_query_log_file | /home/mysql-5.6/mysql-3306/data/test1-slow.log |
+---------------------------+------------------------------------------------+
4 rows in set (0.00 sec)
上述內容就是MYSQL中怎么調整日志組,你們學到知識或技能了嗎?如果還想學到更多技能或者豐富自己的知識儲備,歡迎關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。