MYSQL 8和5主从不一致问题

在配置mysql主从服务器时,我在windows环境下使用mysql5版本作为master,linux环境下mysql8作为slave。

主从建立后,新建数据库和表单都没有报错,但是在master导入数据后slave报错,主从不一致,无法跟随更新。

主要的错误是一个类型转换错误

Column 0 of table 'mysql.user' cannot be converted from type 'char(180(bytes))' to type 'char(255(bytes) ascii) 

查询表字段设计,发现 bigint,int类型的数据在5里面有长度显示

而8.0以上版本没有 

查了查 

官网相关资料:

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)
 

也就是说8.0.17以后的版本int相关的类型都不再能查询长度,属于版本不兼容问题,主从的两个服务器版本还是要用一样的避免兼容性问题

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值