pt-osc操作表以后中文注释显示???

为什么pt-osc操作表以后中文注释显示???,如何避免?

一般来说,生产环境使用的表都会使用中文注释表信息以及字段信息,但是如果使用pt-osc且未指定字符类型的情况下进行在线变更后,中文注释都会变成"???",虽然不影响正常使用,但是对于认为阅读起来会造成困扰,某些平台会依据注释生成数据字典,因此正确的姿势是在使用pt-osc工具时通过--charset=utf8指定utf8字符集

示例:
pt-online-schema-change -h 127.0.0.1 -u xxx -p xxx --alter="add index idx_id(id)" --chunk-size=5000
--print --no-version-check --execute D=xucl,t=test --charset=utf8
 

原文地址:https://www.cnblogs.com/DBABlog/p/12926887.html