如何正確的給innodb表空間添加數(shù)據(jù)文件_MySQL
來源:懂視網(wǎng)
責(zé)編:小采
時(shí)間:2020-11-09 18:00:45
如何正確的給innodb表空間添加數(shù)據(jù)文件_MySQL
如何正確的給innodb表空間添加數(shù)據(jù)文件_MySQL:bitsCN.com 重啟MySQL時(shí)遇到下邊錯(cuò)誤InnoDB: Error: data file /usr/local/mysql/data/ibdata1 is of a different sizeInnoDB: 1152 pages (rounded down to MB)InnoDB: than specified in the .cnf
導(dǎo)讀如何正確的給innodb表空間添加數(shù)據(jù)文件_MySQL:bitsCN.com 重啟MySQL時(shí)遇到下邊錯(cuò)誤InnoDB: Error: data file /usr/local/mysql/data/ibdata1 is of a different sizeInnoDB: 1152 pages (rounded down to MB)InnoDB: than specified in the .cnf

bitsCN.com
重啟MySQL時(shí)遇到下邊錯(cuò)誤
InnoDB: Error: data file /usr/local/mysql/data/ibdata1 is of a different size
InnoDB: 1152 pages (rounded down to MB)
InnoDB: than specified in the .cnf file 1216 pages!
找到原因是因?yàn)榻omysql添加數(shù)據(jù)文件沒有正確配置引起,查看一下當(dāng)前數(shù)據(jù)文件的大小
l# ll -h /usr/local/mysql/data/
-rw-rw---- 1 mysql mysql 18M Mar 5 03:01 ibdata1
修改my.cnf
innodb_data_home_dir =
innodb_data_file_path = /usr/local/mysql/data/ibdata1:18M;/data2/ibdata2:50M:auto extend
這里要特別指出
- linux下查看到數(shù)據(jù)文件是多大就要填寫多大,填大填小都不行。
- /data2/ibdata2這個(gè)目錄/data2需要提前建立,但是ibdata2這個(gè)文件不可以存在
隨后重啟就無提示錯(cuò)誤就ok了。
# /etc/init.d/mysql.server stop
Shutting down MySQL
... *
# /etc/init.d/mysql.server start
Starting MySQL
... *
--EOF--
innodb作者:Buro#79xxd出處:http://www.cnblogs.com/buro79xxd/文章版權(quán)歸本人所有,歡迎轉(zhuǎn)載,但未經(jīng)作者同意必須保留此段聲明,且在文章頁面明顯位置給出原文連接,否則保留追究法律責(zé)任的權(quán)利。bitsCN.com
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
如何正確的給innodb表空間添加數(shù)據(jù)文件_MySQL
如何正確的給innodb表空間添加數(shù)據(jù)文件_MySQL:bitsCN.com 重啟MySQL時(shí)遇到下邊錯(cuò)誤InnoDB: Error: data file /usr/local/mysql/data/ibdata1 is of a different sizeInnoDB: 1152 pages (rounded down to MB)InnoDB: than specified in the .cnf