Forum Moderators: open

Message Too Old, No Replies

mysql 4.0 to mysql 5.0 text field problems

Migration is causing a "1406: Data too long... " error

         

bwakkie

10:09 am on Mar 16, 2009 (gmt 0)

10+ Year Member



I am sort of clueless what to do next. I am more a PostgreSQL guy so I am trying to get into the MySQL world.

After a migration from 4.0 to 5.0 I was receiving 1406 error messages that told me the TEXT field I liked to fill where too long. How can that be?

I figured my problem of a text field could perhaps be due to the char type utf-8 (default in 5.0) instead of the default latin1 in 4.0.
So I exported and imported it back in with Latin1. But no change.

Somehow it only happens when I use the website to insert. If I do changes in the database directly its ok.
Hmmm while typing this last sentence makes me want to check the php.ini... keep you posted

Old system: IIS 5 windows 2000 with php 4.3.4 mysql 4.0
New system: IIS 6 winfows 2003 with php 4.4.2 mysql 5.0

bwakkie

1:47 pm on Mar 16, 2009 (gmt 0)

10+ Year Member



php.ini seamed normal...

I know know that special characters are giving the problem somehow and I have a LOT of utf like characters in my text now:
itÂ?s

Thsi insert will fail:
1406: Data too long for column 'title' at row 1
Database creation error !create:INSERT INTO docs (title, sumtext, media, datepar, category) VALUES ('éééï^cç', 'éééï^cç', '0', '2009-03-16', '0')

bwakkie

2:10 pm on Mar 16, 2009 (gmt 0)

10+ Year Member



out put of SHOW VARIABLES LIKE 'c%'; on both db's

MySQL4:
'character_set', 'latin1'
'character_sets', 'latin1 big5 czech euc_kr gb2312 gbk latin1_de sjis tis620 ujis dec8 dos german1 hp8 koi8_ru latin2 swe7 usa7 cp1251 danish hebrew win1251 estonia hungarian koi8_ukr win1251ukr greek win1250 croat cp1257 latin5'
'concurrent_insert', 'ON'
'connect_timeout', '5'

MYSQL5:
'character_set_client', 'utf8'
'character_set_connection', 'utf8'
'character_set_database', 'utf8'
'character_set_filesystem', 'binary'
'character_set_results', 'utf8'
'character_set_server', 'utf8'
'character_set_system', 'utf8'
'character_sets_dir', 'D:\Program Files\MySQL\MySQL Server 5.0\share\charsets\'
'collation_connection', 'utf8_general_ci'
'collation_database', 'utf8_general_ci'
'collation_server', 'utf8_general_ci'
'completion_type', '0'
'concurrent_insert', '1'
'connect_timeout', '5'

perhaps it gives clues that I do not see (yet)

bwakkie

8:54 pm on Mar 17, 2009 (gmt 0)

10+ Year Member



hmmm I think its just some crazy word unicode characters that are the blocking factor here