While upgrading existing mysql 5.6 to mysql 8 got the warning message logs in mysqld.err logs several times for each database
[Warning] [MY-011825] [InnoDB] Cannot add field abc in table dbName.myTable because after adding it, the row size is 8500 which is greater than maximum allowed size (8126) for a record on index leaf page.
Solution i got on multiple portal is to change row_format compact - > dynamic. is it full proof solution.need to confirm is there any chance of data loss?
To resolve this issue, you have a few options:
Reduce the size of the columns in the table: This is the most straightforward solution. You can try reducing the size of columns in the table that are contributing to the large row size.
Use the BLOB or TEXT data types: If you need to store large amounts of data in a single column, consider using the BLOB or TEXT data types, which can store large amounts of data up to 4 GB.
Split the table into smaller tables: If the table is too large to be managed efficiently, you may want to consider splitting it into smaller, more manageable tables.
Increase the maximum row size limit: You can increase the maximum row size limit by setting the max_allowed_packet system variable to a higher value. However, this approach is not recommended as it can result in performance degradation and may cause other problems.
I recommend trying the first option, reducing the size of the columns, as it is the most straightforward solution and will not result in any performance or stability issues.