Data truncated for column 'text' at row 1

756 views
Skip to first unread message

Sebastian Dahlgren

unread,
Sep 25, 2007, 1:42:48 AM9/25/07
to Django users
Hi!
I have built my site on the Django dev server and everything works
fine there. But when I uploaded the project to a Apache + mod_python
server I got an error

Data truncated for column 'text' at row 1

That is shown when I pass swedish chars like å ä and ö into a form,
which then POST's the form back to the same page. The whole warning-
message reads:

Warning at /
Data truncated for column 'text' at row 1
Request Method: POST
Request URL: http://sql.bidclub.se/
Exception Type: Warning
Exception Value: Data truncated for column 'text' at row 1
Exception Location: /usr/lib/python2.4/site-packages/MySQLdb/
cursors.py in _warning_check, line 80
Python Executable: /usr/bin/python
Python Version: 2.4.4

The POSTing works 'cause when I return to the site I can see the post.
I guess this has something to do with unicode or something, but I
don't really know where to look.

Any hint is really appreciated!

Thanks in advance

Message has been deleted

Andrey Khavryuchenko

unread,
Sep 25, 2007, 7:10:39 AM9/25/07
to django...@googlegroups.com

SD> Data truncated for column 'text' at row 1

[...]

SD> The POSTing works 'cause when I return to the site I can see the post.
SD> I guess this has something to do with unicode or something, but I
SD> don't really know where to look.

SD> Any hint is really appreciated!

This means exactly what's written there: data was truncated. Check how
long 'text' column is and, probably, alter table to increase its size.

--
Andrey V Khavryuchenko
Django NewGate - http://www.kds.com.ua/djiggit/
Development - http://www.kds.com.ua
Call akhavr1975 on www.gizmoproject.com

Ester Ytterbrink

unread,
Sep 28, 2007, 2:10:57 AM9/28/07
to Django users
I had the same problem, caused by using the letters å, ä and ö, when
editing my database from the admin page.
For me it was solved by recreating the database with character set
utf8 and collation utf8_unicode_ci.
I use MySql 5.0.37 and Django 0.96.

http://dev.mysql.com/doc/refman/4.1/en/charset-general.html

I hope it helps. Ester Ytterbrink

Dushyant Sharma

unread,
Sep 28, 2007, 5:14:14 AM9/28/07
to Django users
the problem seems to be your database installation. you can increase
CharField length by installaing mysql version 5.xx.
also check what database you are using and character set it supports.

On Sep 25, 10:42 am, Sebastian Dahlgren <sebastian.dahlg...@gmail.com>
wrote:

francois

unread,
Nov 12, 2007, 9:19:03 AM11/12/07
to Django users
Same problem for me with French characters. All the rest of the site
works fine just the admin section which doesn't want non English
characters.

What we should try or check at this point?

Thanks for an eventual answer, hint, suggestion...

francois

On Sep 25, 6:42 am, Sebastian Dahlgren <sebastian.dahlg...@gmail.com>
wrote:

francois

unread,
Nov 12, 2007, 9:24:17 AM11/12/07
to Django users
Ooops sorry I didn't saw the answers in my Google search result.
I will try the suggestion of Ester Ytterbrink.

Thanks

Reply all
Reply to author
Forward
0 new messages