久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

MYSQL中怎么調整日志組

146次閱讀
沒有評論

共計 1728 個字符,預計需要花費 5 分鐘才能閱讀完成。

自動寫代碼機器人,免費開通

本篇文章為大家展示了 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 中怎么調整日志組,你們學到知識或技能了嗎?如果還想學到更多技能或者豐富自己的知識儲備,歡迎關注丸趣 TV 行業資訊頻道。

向 AI 問一下細節

正文完
 
丸趣
版權聲明:本站原創文章,由 丸趣 2023-12-04發表,共計1728字。
轉載說明:除特殊說明外本站除技術相關以外文章皆由網絡搜集發布,轉載請注明出處。
評論(沒有評論)
主站蜘蛛池模板: 蓝山县| 方正县| 定州市| 五指山市| 临高县| 万全县| 墨玉县| 兴国县| 琼海市| 利津县| 灯塔市| 旬邑县| 神池县| 墨江| 磐安县| 楚雄市| 洞口县| 三门峡市| 洪洞县| 长垣县| 新津县| 邮箱| 云和县| 南安市| 清丰县| 无棣县| 漠河县| 连江县| 沅江市| 江都市| 吉林市| 奉贤区| 邵武市| 吐鲁番市| 徐水县| 赫章县| 剑阁县| 敦化市| 会理县| 井冈山市| 苏尼特右旗|