Is it possible to globally configure all char/varchar/text columns in a mysql database to use utf8?
I have a database that I had imported and accidentally created some tables as using lat开发者_如何学Goin1 by default. I've altered the tables and the database, but the columns are still latin1. I don't really have any reason to use latin1, so is there any way to just change all columns to use utf8? This is a development database, so it doesn't necessarily have to be something that would work (or be a good idea) in production.
This has been discussed over at ServerFault; in the answers you'll find a query to read column names from the schema table and then convert each column:
https://serverfault.com/questions/65043/alter-charset-and-collation-in-all-columns-in-all-tables-in-mysql
精彩评论