mysql8.0.19中在navicat客戶端中int、bigint等類型設(shè)置長
問題描述:
今天在將開發(fā)庫(mysql版本號:5.7.24)的表結(jié)構(gòu)和正式庫(mysql版本號:8.0.19)表結(jié)構(gòu)做比對的時候,發(fā)現(xiàn)大量表中字段不一致,初以為是切換到正式庫時執(zhí)行SQL報錯了,后,手工修改表字段長度還是不行。
操作過程:
在navicat中修改表中bigint字段長度如下:
在linux中登錄mysql,執(zhí)行表修改語句如下:
mysql> ALTER TABLE `mall_app_notice` MODIFY COLUMN `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主鍵' FIRST;
發(fā)現(xiàn)有告警信息,接下來執(zhí)行:
mysql> show warnings;
執(zhí)行的截圖界面如下圖所示:
原因分析:
根據(jù)告警的提示信息指出:integer的寬度顯示將在未來版本被移除
查閱官網(wǎng)資料如下:
官網(wǎng)相關(guān)資料:
MySQL Server 8.0.17 deprecated the display width for the TINYINT
, SMALLINT
, MEDIUMINT
, INT
, and BIGINT
data types when the ZEROFILL
modifier is not used, and MySQL Server 8.0.19 has removed the display width for those data types from results of SHOW CREATE TABLE
, SHOW CREATE FUNCTION
, and queries on INFORMATION_SCHEMA.COLUMNS
, INFORMATION_SCHEMA.ROUTINES
, and INFORMATION_SCHEMA.PARAMETERS
(except for the display width for signed TINYINT(1)
). This patch adjusts Connector/J to those recent changes of MySQL Server and, as a result, DatabaseMetaData
, ParameterMetaData
, and ResultSetMetaData
now report identical results for all the above-mentioned integer types and also for the FLOAT
and DOUBLE
data types. (Bug #30477722)
根據(jù)官網(wǎng)資料可知:從8.0.17版本開始,TINYINT
, SMALLINT
, MEDIUMINT
, INT
, and BIGINT類型的顯示寬度將失效。
想了解更多?現(xiàn)在就開始免費體驗