Row size too large Changing some columns to TEXT o

日前在作mysql備份還原的時候出現了一個問題,全備數據庫再還原,在還原時候會出現如下錯誤:mysql

ERROR 1118 (42000) at line 1480: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline

百度和谷歌了一通後總結緣由爲:mysql在存儲臨時文件類的數據庫的時候默認使用innodb做爲數據庫存儲引擎,而這個存儲類型的最大支持行數爲8126,針對此類問題有如下幾個方法:
sql

一、修改所在的數據庫存儲引擎爲innodb數據庫

二、設置行格式爲動態 bash

SET GLOBAL innodb_default_row_format='dynamic';

若是不肯定本身的數據庫行格式是什麼能夠使用如下命令查詢:ide

show global VARIABLES like '%innodb_default_row_format%'

三、關閉innodb嚴格格式
spa

set global innodb_strict_mode=OFF

PS:剛開始我把這些設置加在/etc/my.cnf裏面,我用helm安裝的mariadb pod啓動會報錯,識別不到這個參數,因此我只能使用全局命令
orm

相關文章
相關標籤/搜索