pt-osc 变更时遇到 “MySQL error 1300” 报错问题解决
目的
线上一张表的字段长度变更
`sGuid` varchar(255) DEFAULT NULL COMMENT 'sGuid'
=》
`sGuid` varchar(512) DEFAULT NULL COMMENT 'sGuid'
方法
pt-online-schema-change --user=xxxx--password=xxxxxx --host=127.0.0.1 --port= \
--charset=utf8mb4 D=db_main,t=tb_main \
--alter "modify sGuid varchar(512) DEFAULT NULL COMMENT 'sGuid'" \
--no-check-alter --no-check-replication-filters --alter-foreign-keys-method=auto --recursion-method=none \
--critical-load="Threads_running=50" --max-load="Threads_running=100" \
--print --execute
执行时报错:
--25T11:: Error copying rows from `db_main`.`tb_main` to `db_main`.`_tb_main_new`: --25T11:: Copying rows caused a MySQL error :
Level: Warning
Code:
Message: Invalid utf8 character string: 'CE'
在 percona 官网找到原因: https://jira.percona.com/browse/PT-1528 ,这里直接贴出原因。
pt-online-schema-change could emit utf8 errors for binary PK: Workaround specify latin1 charset for pt-o-s-c: pt-online-schema-change --execute --charset=latin1 --chunk-size 2 --alter 'engine=innodb' D=test,t=brokenutf8alter pt-o-s-c still processes the table correctly (utf8mb4 symbols stored in additional varchar field are valid after pt-o-s-c run). 4-byte changes also processed correctly by pt-o-s-c triggers. Possible fix: use binary or hex literals instead of '?' substitution.
解决
用 latin1 字符集代替 utf8
pt-online-schema-change --user=xxxx--password=xxxxxx --host=127.0.0.1 --port= \
--charset=latin1 D=db_main,t=tb_main \
--alter "modify sGuid varchar(512) DEFAULT NULL COMMENT 'sGuid'" \
--no-check-alter --no-check-replication-filters --alter-foreign-keys-method=auto --recursion-method=none \
--critical-load="Threads_running=50" --max-load="Threads_running=100" \
--print --execute
pt-osc 变更时遇到 “MySQL error 1300” 报错问题解决的更多相关文章
- idea maven javaweb项目迁移时的maven和版本报错问题解决(可解决同类错误)
项目中代码红线报版本不支持xx语法,只需要将java版本设置为当前机器使用的java版本即可 这里我使用的是idea自带的maven,如果是自己安装的maven需要在 home directory 处 ...
- MySQL主从1205报错【转】
主从报错1205 Slave SQL thread retried transaction 10 time(s) in vain, giving up. Consider raising the va ...
- 安装hue时,make apps 编译报错
安装hue时,make apps 编译报错 :"Error: must have python development packages for 2.6 or 2.7. Could not ...
- mysql执行update报错1175解决方法
mysql执行update报错 update library set status=true where 1=1 Error Code: 1175. You are using safe update ...
- mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY
mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY 今天开发的同事发来如下错误信息,最最简 ...
- ROS常见问题(一) 安装ROS时sudo rosdep init指令报错 最全解决方法
安装ROS时sudo rosdep init指令报错: ERROR: cannot download default sources list from: https://raw.githubuser ...
- LoadRunner接口测试Error -27225报错解决
今天依照规范写了一个接口测试脚本,再执行的时候报Error -27225,核对了接口字段和字段值没发现错误,百度搜Error -27225错误没有相关解释.这个问题经过溯源找到了问题的所在,为了互帮互 ...
- Mysql update in报错 [Err] 1093 - You can't specify target table 'company_info' for update in FROM clause
Mysql update in报错 解决方案: [Err] 1093 - You can't specify target table 'company_info' for update in FRO ...
- dotnetcore ef 调用多个数据库时用户命令执行操作报错
dotnetcore ef 调用多个数据库时用户命令执行操作报错 1.多个DbContext 时报错: 报错: More than one DbContext was found. Specify w ...
随机推荐
- loj #10131
抽离题意 求删除一条树边和一条非树边后将图分成不连通的两部分的方案数 对于一棵树,再加入一条边就会产生环.若只有一个环,说明只加入了一条非树边 (x, y),记 lca 为 l, 那么 对于任意一条 ...
- linux安装sox,踩过坑的方法
参考文章 : https://blog.csdn.net/e_zhiwen/article/details/80037476 重新在源码中 执行一遍 ./configure --prefix=$HOM ...
- 自主设计BootLoader框架笔记一栏
- Java 死锁以及死锁的产生
public class DeadLockSample { public static void main(String[] args) { DeadLock d1 = new DeadLock(tr ...
- hive 属性随笔记录
set hive.mapred.mode=strict; //设置hive执行模式,默认为nonstrict(非严格模式),这里设置为严格模式 set hiveconf:hive.cli.print. ...
- Docker|部署及简单使用
环境:VMware + centos7 + docker17.05.0 一.安装docker 1.修改ifcfg-ens33 配置虚拟机的网络,保证可以正常联网 命令:vi /etc/sysconfi ...
- Assignment4:闰年判断输入异常时的处理方法
一.问题描述 在输入界面输入年份,界面返回是否为闰年. 判断依据为:输入的数字可以被4整除但不可以被100整除 || 输入的数字可以被400整除 如果输入为数字以外的其他字符,会抛出异常.那么如何防止 ...
- [设计原则与模式] 如何理解TDD的三条规则
cp from : https://blog.csdn.net/ibelieve1974/article/details/54948031 如何理解Bob大叔的TDD三条规则?第一条和第三条讲的是 ...
- 《Linux性能及调优指南》 Linux进程管理
版权所有: 原文名称:<Linux Performance and Tuning Guidelines> 原文地址:http://www.redbooks.ibm.com/abstract ...
- Javascript之hoisting变量提升
javascript不仅仅是一门弱类型语言,还是一门解释型语言.一门编程语言的本质就是这样,优点即是缺点,缺点也往往是优点.JS因为有了变量提升,能够使我们在编程时可以忽略“先声明,再使用”的规则,但 ...