ITPub博客

首页 > 数据库 > MySQL > pt-online-schema-change 错误集 Wide character

pt-online-schema-change 错误集 Wide character

原创 MySQL 作者:e71hao 时间:2022-09-06 10:51:42 0 删除 编辑

1.  pt-online-schema-change 错误1 :字符集错误

pt-online-schema-change -uroot  -p123456  -S /data/test1_mysql/mysql.sock  --max-load="Threads_running=20"  --statistics --print --alter "modify  column remark varchar(20) NOT NULL DEFAULT '' COMMENT '备注'" D=stu,t=score --execute

Operation, tries, wait:

  analyze_table, 10, 1

  copy_rows, 10, 0.25

  create_triggers, 10, 1

  drop_triggers, 10, 1

  swap_tables, 10, 1

  update_foreign_keys, 10, 1

Altering `stu`.`score`...

Creating new table...

Error creating new table: Wide character in print at /bin/pt-online-schema-change line 10814.


Wide character in print 是perl在遇到字符集问题的时候报错。perl只能处理2种字符集:ascii和utf8,要修改的语句 modify  column remark varchar(20) NOT NULL DEFAULT '' COMMENT 'note' 列remark 注释是中文,报了上面错误。还有一种情况下,整个创建表语句有中文。

需要增加字符集参数 --charset=utf8,注意大小写。你写成--charset=UTF8, --charset=uTF8, --charset=UTF8mb4 , --charset=utf8mb4,都会报错wide character。

确实怎么试验都有错误的话,也有另外一个解决办法:把 列所有中文注释改成英文的。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30393770/viewspace-2913563/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2015-08-05

  • 博文量
    133
  • 访问量
    235551