本篇文章為大家展示了MYSQL中怎么調(diào)整日志組,內(nèi)容簡明扼要并且容易理解,絕對能使你眼前一亮,通過這篇文章的詳細介紹希望你能有所收獲。
成都創(chuàng)新互聯(lián)專注于企業(yè)營銷型網(wǎng)站、網(wǎng)站重做改版、神池網(wǎng)站定制設(shè)計、自適應(yīng)品牌網(wǎng)站建設(shè)、H5開發(fā)、商城網(wǎng)站開發(fā)、集團公司官網(wǎng)建設(shè)、成都外貿(mào)網(wǎng)站建設(shè)公司、高端網(wǎng)站制作、響應(yīng)式網(wǎng)頁設(shè)計等建站業(yè)務(wù),價格優(yōu)惠性價比高,為神池等各大城市提供網(wǎng)站開發(fā)制作服務(wù)。1、查看關(guān)閉方式:
mysql> show variables like '%fast%';
+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| innodb_fast_shutdown | 1 |
+----------------------+-------+
1 row in set (0.00 sec)
該參數(shù)解釋如下:,默認值為1,設(shè)置為0 是干凈的關(guān)閉 和ORACLE里面shutdown immeidate對應(yīng)
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、調(diào)整參數(shù)innodb_fast_shutdown為0
set global innodb_fast_shutdown=0
3、關(guān)閉MYSQL
mysqladmin -uroot shutdown -S /home/mysql-5.6/mysql-3306/mysql.sock
4、調(diào)整REDO大小,日志文件默認命名是ib_logfile開頭
1、找到REDO文件所在目錄(有幾個文件處理幾個,移動到其他目錄)。
mv ib_logfilexx ../ ib_logfilexx
2、添加參數(shù):日志組個數(shù)和日志大小到參數(shù)文件
在參數(shù)文件[mysqld]下面添加如下參數(shù)
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、查看修改后的日志組大小和個數(shù)
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)
上述內(nèi)容就是MYSQL中怎么調(diào)整日志組,你們學(xué)到知識或技能了嗎?如果還想學(xué)到更多技能或者豐富自己的知識儲備,歡迎關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司行業(yè)資訊頻道。