濮阳杆衣贸易有限公司

主頁(yè) > 知識(shí)庫(kù) > MySQL修改innodb_data_file_path參數(shù)的一些注意事項(xiàng)

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

熱門(mén)標(biāo)簽:福建外呼電銷機(jī)器人加盟 400電話申請(qǐng)廠家現(xiàn)貨 自己做地圖標(biāo)注需要些什么 中國(guó)地圖標(biāo)注公司 百度地圖標(biāo)注要什么軟件 昌德訊外呼系統(tǒng) 電話機(jī)器人的價(jià)格多少錢(qián)一個(gè)月 天津公司外呼系統(tǒng)軟件 徐涇鎮(zhèn)騰訊地圖標(biāo)注

前言

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

說(shuō)明

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

方法一:推薦

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

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

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

方法二:不推薦

直接改為如下的話

[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é)

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

您可能感興趣的文章:
  • MySQL btree索引與hash索引區(qū)別
  • 簡(jiǎn)單了解mysql InnoDB MyISAM相關(guān)區(qū)別
  • 簡(jiǎn)述MySQL InnoDB存儲(chǔ)引擎
  • MySQL Innodb 存儲(chǔ)結(jié)構(gòu) 和 存儲(chǔ)Null值 用法詳解
  • MySQL啟動(dòng)報(bào)錯(cuò)問(wèn)題InnoDB:Unable to lock/ibdata1 error
  • 詳解MySQL(InnoDB)是如何處理死鎖的
  • mysql更改引擎(InnoDB,MyISAM)的方法
  • 可以改善mysql性能的InnoDB配置參數(shù)
  • mysql報(bào)錯(cuò):MySQL server version for the right syntax to use near type=InnoDB的解決方法
  • MySQL數(shù)據(jù)庫(kù)innodb啟動(dòng)失敗無(wú)法重啟的解決方法
  • 獲取 MySQL innodb B+tree 的高度的方法

標(biāo)簽:陜西 黔西 梅河口 北京 鄂爾多斯 駐馬店 昌都 荊門(mén)

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《MySQL修改innodb_data_file_path參數(shù)的一些注意事項(xiàng)》,本文關(guān)鍵詞  MySQL,修改,innodb,data,file,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《MySQL修改innodb_data_file_path參數(shù)的一些注意事項(xiàng)》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于MySQL修改innodb_data_file_path參數(shù)的一些注意事項(xiàng)的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    安阳市| 措勤县| 盐池县| 资溪县| 南城县| 汉川市| 平邑县| 洪湖市| 曲阜市| 富阳市| 黎城县| 广元市| 舒城县| 扶余县| 青河县| 原阳县| 陆良县| 天镇县| 京山县| 嵩明县| 任丘市| 图们市| 建瓯市| 三台县| 西盟| 新源县| 潼南县| 长宁县| 西安市| 会东县| 沅江市| 芜湖市| 阳泉市| 神农架林区| 灌阳县| 那坡县| 湘西| 巴彦县| 东莞市| 昌宁县| 玛纳斯县|