views:

283

answers:

1

Hi, I have a mysql database that holds content as a blob, for whatever reason those developers chose to use a blob is out of my control. Is it possible to convert the data to text and the data type to text?

+1  A: 

have you tried the alter table command ?

alter table mytable change mycolumn mycolumn text;

from http://forums.mysql.com/read.php?103,164923,167648#msg-167648 it looks like you can use CAST.

you could create a new (TEXT) column, then fill it in with an update command:

update mytable set myNewColumn = CAST(myOldColumn AS CHAR(10000) CHARACTER SET utf8)
John Boker
I've gone from text to blob and back with no change in the data.
Daren Schwenke