最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

MySQL修改innodb_data_file_path參數(shù)的一些注意事項(xiàng)

 更新時(shí)間:2019年04月04日 09:47:15   作者:moerjinrong  
這篇文章主要給大家介紹了關(guān)于MySQL修改innodb_data_file_path參數(shù)的一些注意事項(xiàng),文中通過示例代碼介紹的非常詳細(xì),對大家學(xué)習(xí)或者使用MySQL具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧

前言

innodb_data_file_path用來指定innodb tablespace文件,如果我們不在My.cnf文件中指定innodb_data_home_dir和innodb_data_file_path那么默認(rèn)會(huì)在datadir目錄下創(chuàng)建ibdata1 作為innodb tablespace。

說明

在測試環(huán)境下沒有設(shè)置過多的詳細(xì)參數(shù)就初始化并啟動(dòng)了服務(wù),后期優(yōu)化的過程中發(fā)現(xiàn)innodb_data_file_path設(shè)置過?。?br />

root@node1 14:59: [(none)]> show variables like '%innodb_data_file_path%';
+-----------------------+------------------------+
| Variable_name | Value  |
+-----------------------+------------------------+
| innodb_data_file_path | ibdata1:12M:autoextend |
+-----------------------+------------------------+
1 row in set (0.00 sec)

root@node1 14:59: [(none)]>

當(dāng)沒有配置innodb_data_file_path時(shí),默認(rèn)innodb_data_file_path = ibdata1:12M:autoextend

[mysqld]
innodb_data_file_path = ibdata1:12M:autoextend

當(dāng)需要改為1G時(shí),不能直接在配置文件把 ibdata1 改為 1G ,

[mysqld]
innodb_data_file_path = ibdata1:1G:autoextend

否則啟動(dòng)服務(wù)之后,從錯(cuò)誤日志看到如下報(bào)錯(cuò):

2019-03-29T06:47:32.044316Z 0 [ERROR] InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size 768 pages (rounded down to MB) than specified in the .cnf file: initial 65536 pages, max 0 (relevant if non-zero) pages!

大致意思就是ibdata1的大小不是 65536page*16KB/1024KB=1G ,而是 786page*16KB/1024KB=12M
(未使用壓縮頁)

方法一:推薦

而應(yīng)該再添加一個(gè) ibdata2:1G ,如下:

[mysqld]
innodb_data_file_path = ibdata1:12M;ibdata2:1G:autoextend

重啟數(shù)據(jù)庫!

方法二:不推薦

直接改為如下的話

[mysqld]
innodb_data_file_path = ibdata1:1G:autoextend

可以刪除$mysql_datadir目錄下 ibdata1、ib_logfile0、ib_logfile1 文件:

rm -f ibdata* ib_logfile*

也可以啟動(dòng)MySQL,但是mysql錯(cuò)誤日志里會(huì)報(bào)如下錯(cuò)誤:

2019-03-29T07:10:47.844560Z 0 [Warning] Could not increase number of max_open_files to more than 5000 (request: 65535)
2019-03-29T07:10:47.844686Z 0 [Warning] Changed limits: table_open_cache: 1983 (requested 2000)
2019-03-29T07:10:48.028262Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2019-03-29T07:10:48.147653Z 0 [Warning] InnoDB: Cannot open table mysql/plugin from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
mysqld: Table 'mysql.plugin' doesn't exist
2019-03-29T07:10:48.147775Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2019-03-29T07:10:48.163444Z 0 [Warning] InnoDB: Cannot open table mysql/gtid_executed from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
mysqld: Table 'mysql.gtid_executed' doesn't exist
2019-03-29T07:10:48.163502Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2019-03-29T07:10:48.163658Z 0 [Warning] InnoDB: Cannot open table mysql/gtid_executed from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
mysqld: Table 'mysql.gtid_executed' doesn't exist
2019-03-29T07:10:48.163711Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2019-03-29T07:10:48.164619Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2019-03-29T07:10:48.166805Z 0 [Warning] InnoDB: Cannot open table mysql/server_cost from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
2019-03-29T07:10:48.166891Z 0 [Warning] Failed to open optimizer cost constant tables

2019-03-29T07:10:48.168072Z 0 [Warning] InnoDB: Cannot open table mysql/time_zone_leap_second from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
2019-03-29T07:10:48.168165Z 0 [Warning] Can't open and lock time zone table: Table 'mysql.time_zone_leap_second' doesn't exist trying to live without them
2019-03-29T07:10:48.169454Z 0 [Warning] InnoDB: Cannot open table mysql/servers from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
2019-03-29T07:10:48.169527Z 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
2019-03-29T07:10:48.170042Z 0 [Warning] InnoDB: Cannot open table mysql/slave_master_info from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
2019-03-29T07:10:48.170617Z 0 [Warning] InnoDB: Cannot open table mysql/slave_relay_log_info from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
2019-03-29T07:10:48.170946Z 0 [Warning] InnoDB: Cannot open table mysql/slave_master_info from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
2019-03-29T07:10:48.171046Z 0 [Warning] Info table is not ready to be used. Table 'mysql.slave_master_info' cannot be opened.
2019-03-29T07:10:48.171272Z 0 [Warning] InnoDB: Cannot open table mysql/slave_worker_info from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
2019-03-29T07:10:48.171626Z 0 [Warning] InnoDB: Cannot open table mysql/slave_relay_log_info from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
2019-03-29T07:10:48.171688Z 0 [Warning] Info table is not ready to be used. Table 'mysql.slave_relay_log_info' cannot be opened.

總結(jié)

以上就是這篇文章的全部內(nèi)容了,希望本文的內(nèi)容對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,謝謝大家對腳本之家的支持。

相關(guān)文章

  • 在 Windows 10 上安裝 解壓縮版 MySql(推薦)

    在 Windows 10 上安裝 解壓縮版 MySql(推薦)

    這篇文章主要介紹了在 Windows 10 上安裝 解壓縮版 MySql(推薦)的相關(guān)資料,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下
    2016-12-12
  • MySQL數(shù)據(jù)庫數(shù)據(jù)塊大小及配置方法

    MySQL數(shù)據(jù)庫數(shù)據(jù)塊大小及配置方法

    MySQL作為一種流行的關(guān)系數(shù)據(jù)庫管理系統(tǒng),在處理大規(guī)模數(shù)據(jù)存儲和查詢時(shí),數(shù)據(jù)塊(data block)大小是一個(gè)至關(guān)重要的因素,本文將詳細(xì)探討MySQL數(shù)據(jù)庫的數(shù)據(jù)塊大小,結(jié)合實(shí)際例子說明其重要性和配置方法,感興趣的朋友跟隨小編一起看看吧
    2024-05-05
  • MySQL 8.0 新特性之哈希連接(Hash Join)

    MySQL 8.0 新特性之哈希連接(Hash Join)

    MySQL 開發(fā)組于 2019 年 10 月 14 日 正式發(fā)布了 MySQL 8.0.18 GA 版本,帶來了一些新特性和增強(qiáng)功能。這篇文章主要介紹了MySQL 8.0 新特性之哈希連接(Hash Join),需要的朋友可以參考下
    2019-10-10
  • MySQL外鍵類型及應(yīng)用場景總結(jié)

    MySQL外鍵類型及應(yīng)用場景總結(jié)

    這篇文章主要介紹了?MySQL?外鍵的類型(RESTRICT、CASCADE、SET?NULL、NO?ACTION)及其應(yīng)用場景、優(yōu)缺點(diǎn)和使用注意事項(xiàng),通過創(chuàng)建和測試外鍵,闡述了不同類型外鍵在主表刪除或更新數(shù)據(jù)時(shí)子表的變化,需要的朋友可以參考下
    2024-12-12
  • MySQL之表碎片化的問題解決

    MySQL之表碎片化的問題解決

    MySQL數(shù)據(jù)庫的碎片是由于頻繁的增刪改查操作導(dǎo)致的數(shù)據(jù)塊不連續(xù)或不規(guī)則分布,本文主要介紹了MySQL之表碎片化的問題解決,具有一定的參考價(jià)值,感興趣的可以了解一下
    2024-08-08
  • MySQL常用日期時(shí)間函數(shù)示例詳解

    MySQL常用日期時(shí)間函數(shù)示例詳解

    MySQL提供了大量的日期和時(shí)間函數(shù),這些函數(shù)用于在查詢中處理和操作日期與時(shí)間值,這篇文章主要介紹了MySQL常用日期時(shí)間函數(shù),需要的朋友可以參考下
    2024-06-06
  • MySQL日志維護(hù)策略匯總

    MySQL日志維護(hù)策略匯總

    這篇文章主要介紹了MySQL日志維護(hù)策略匯總,需要的朋友可以參考下
    2015-08-08
  • linux系統(tǒng)下安裝配置解壓版的MySQL數(shù)據(jù)庫圖解

    linux系統(tǒng)下安裝配置解壓版的MySQL數(shù)據(jù)庫圖解

    這篇文章主要介紹了linux系統(tǒng)下安裝配置解壓版的MySQL數(shù)據(jù)庫的相關(guān)資料,需要的朋友可以參考下
    2017-12-12
  • Mysql怎么存儲json格式數(shù)據(jù)詳解

    Mysql怎么存儲json格式數(shù)據(jù)詳解

    在開發(fā)中遇到存取html值的情況,并且要根據(jù)id進(jìn)行實(shí)時(shí)返回,在做的時(shí)候想到了mysql的json類型存儲,下面這篇文章主要給大家介紹了關(guān)于Mysql怎么存儲json格式數(shù)據(jù)的相關(guān)資料,需要的朋友可以參考下
    2022-06-06
  • MySQL??zip安裝包配置教程

    MySQL??zip安裝包配置教程

    這篇文章詳細(xì)介紹了如何使用zip安裝包在Windows11上安裝MySQL8.0,包括下載、解壓、配置環(huán)境變量、初始化數(shù)據(jù)庫、安裝服務(wù)以及更改密碼等步驟,感興趣的朋友一起看看吧
    2025-02-02

最新評論

石家庄市| 拜泉县| 北票市| 虎林市| 莱州市| 六枝特区| 辽阳市| 德格县| 夏邑县| 公主岭市| 禹城市| 孟津县| 清水河县| 五原县| 吕梁市| 惠水县| 万盛区| 甘德县| 泊头市| 大兴区| 黔西| 平阴县| 和硕县| 蚌埠市| 定陶县| 鸡泽县| 烟台市| 民乐县| 郧西县| 沙田区| 合川市| 五大连池市| 乌审旗| 卓资县| 高清| 安岳县| 铜山县| 获嘉县| 普定县| 桂东县| 巴青县|