I have a whole lot of records where text has been stored in a blob in MySQL. For ease of handling I'd like to change the format in the database to TEXT... Any ideas how easily to make the change so as not to interrupt the data - I guess it will need to be encoded properly?
相关问题
- SQL join to get the cartesian product of 2 columns
- sql execution latency when assign to a variable
- Difference between Types.INTEGER and Types.NULL in
- php PDO::FETCH_ASSOC doesnt detect select after ba
- sqlyog export query result as csv
I have had the same problem, and here is my solution:
After some googling for you I've found this. It's an answer to a person who wants to convert a blob to char(1000) with UTF-8 encoding:
This is his answer. There is probably much more you can read about CAST right here. I hope it helps some.
Or you can use this function:
You can do it very easily.
The above query worked for me. I hope it helps you too.
That's unnecessary. Just use
SELECT CONVERT(column USING utf8) FROM
..... instead of justSELECT column FROM
...