Master-slave inconsistency between MYSQL 8 and 5

When configuring the mysql master-slave server, I use the mysql5 version as the master in the windows environment, and the mysql8 version as the slave in the linux environment.

After the master-slave is established, no error is reported for the new database and form, but after the master imports data, the slave reports an error, the master-slave is inconsistent, and cannot follow the update.

The main error is a type conversion error

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

Query the field design of the table and find that the data of type bigint and int has a length display in 5

Versions above 8.0 do not 

checked 

Official website related information:

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)
 

That is to say, int-related types in versions after 8.0.17 can no longer query the length, which is a version incompatibility issue. The two server versions of the master and slave should still use the same to avoid compatibility issues.

Supongo que te gusta

Origin blog.csdn.net/NerfmePlz/article/details/127709455
Recomendado
Clasificación