Error Code: 1406. Data too long for column 'txtContabilidade' at row 1

0

In MySQL ..

I want to do UPDATE in a text field, it has about 300 characters and does not allow doing it, informed that it is too long. I have already tried changing the field type up to "Longtext", "VARCHAR (1000)" and did not allow it. Is there any limitation on MySQL settings or something? What to do in this situation?

    
asked by anonymous 06.08.2014 / 20:24

1 answer

2

Changing the field to longtext should solve the problem, this error is triggered when the amount of characters is larger than the field store, then the surplus characters are truncated.

The limit of the varchar field is 255 (0 to 255).

Try changing to longtext again, remember to change the table name, CHARACTER SET, and DEFAULT if necessary

ALTER TABLE nomeDaTabela CHANGE txtContabilidade txtContabilidade LONGTEXT CHARACTER 
    SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL;

If you can not, send the problem, query insert, query select, and table structure codes, which I'll test here and help you solve this.

    
07.08.2014 / 15:03