首页域名资讯 正文

pt-online-schema-change utf8mb4 错误解决方法

2024-10-30 1 0条评论

Character set ‘utf8mb4’ is not a compiled character set and is not specified in the ‘/usr/share/mysql/charsets/Index.xml’ file
Character set ‘utf8mb4’ is not a compiled character set and is not specified in the ‘/usr/share/mysql/charsets/Index.xml’ file
Cannot connect to MySQL: DBI connect(‘med_data;host=127.0.0.1;mysql_read_default_group=client’,’root’,…) failed: Can’t initialize character set utf8mb4 (path: /usr/share/mysql/charsets/) at /usr/bin/pt-online-schema-change line 2281

更改/usr/share/mysql/charsets/Index.xml 内容,将

1 2 3 4 5 6 7 8 9 10 11 12 13 < charset name = “utf8” >    < family > Unicode < / family >    < description > UTF 8 Unicode < / description >    < alias > utf 8 < / alias >    < collation name = “utf8_general_ci”      id = “33” >    < flag > primary < / flag >    < flag > compiled < / flag >    < / collation >    < collation name = “utf8_bin”              id = “83” >      < flag > binary < / flag >      < flag > compiled < / flag >    < / collation > < / charset >

改为

1 2 3 4 5 6 7 8 9 10 11 12 13 < charset name = “utf8mb4” >    < family > Unicode < / family >    < description > UTF 8 Unicode < / description >    < alias > utf 8 < / alias >    < collation name = “utf8_general_ci”      id = “33” >    < flag > primary < / flag >    < flag > compiled < / flag >    < / collation >    < collation name = “utf8_bin”              id = “83” >      < flag > binary < / flag >      < flag > compiled < / flag >    < / collation > < / charset >

不光光pt-online-schema-change工具会遇到这个问题,其它工具也会,也是这么解决的。

文章转载来自:trustauth.cn

文章版权及转载声明

本文作者:亿网 网址:https://edns.com/ask/post/150777.html 发布于 2024-10-30
文章转载或复制请以超链接形式并注明出处。