开发者

Is it possible to globally configure all char/varchar/text columns in a mysql database to use utf8?

开发者 https://www.devze.com 2023-01-18 12:18 出处:网络
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\'

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

0

精彩评论

暂无评论...
验证码 换一张
取 消