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 ...
随机推荐
- word collocations中文版(信息检索)
虽然说是大作业,也做了好几天,但是完全没有什么实际价值...就是把现有的东西东拼西凑一下,发现跑的特别慢还搞了个多核 写这篇blog纯属是我吃饱了没事干,记录一下装env的蛋疼 首先我们是在pytho ...
- AtCoder Grand Contest 007题解
传送门 \(A\) 咕咕咕 //quming #include<bits/stdc++.h> #define R register #define fp(i,a,b) for(R int ...
- ORA-01578: ORACLE 数据块损坏 (文件号 13, 块号 2415081) ORA-01110: 数据文件XXXXXX
1.使用DBV检查数据文件,在cmd执行:dbv file='E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF' blocksize=8192:然后等待检测结 ...
- SweetAlert 2 全网最详细的使用方法
官网链接 SweetAlert2 官网链接 准备阶段 CDN js 如果该 链接 时间久远了 , 可以在官网去找找最新的 可以把 js 复制出来 自己新建一个文件 然后 引用到 html 中 1. 带 ...
- LeetCode之打家劫舍
1. 问题 在一条直线上,有n个房屋,每个房屋中有数量不等的财宝,有一个盗 贼希望从房屋中盗取财宝,由于房屋中有报警器,如果同时从相邻的两个房屋中盗取财宝就会触发报警器.问在不触发报警器的前提下,最多 ...
- centos7下修改docker工作目录
应用环境: docker安装时如果不指定家目录(也就是工作目录),一般默认工作目录是 /var/lib/docker ,很多时候需要修改到大容量磁盘上进行存储,这里记录一下修改默认路径为 /data/ ...
- mac安装rust
1.安装 curl https://sh.rustup.rs -sSf | sh 使用brew各种出错,还慢. 2编译 source $HOME/.cargo/env 3.版本查看 rustc --v ...
- TreeFrog Framework : High-speed C++ MVC Framework for Web Application http://www.treefrogframework.org
TreeFrog Framework : High-speed C++ MVC Framework for Web Application http://www.treefrogframework.o ...
- 基于 Binlog + Flink 实现多表数据同构/异构方案
https://mp.weixin.qq.com/s/1h942YAcS6fhO5C43hGX-w 什么是数据异构?简单讲,就是将数据进行异地数据异构存储. 数据异构 服务市场使用 BinLake(京 ...
- Flutter -------- Drawer侧滑
侧滑菜单在安卓App里面非常常见 抽屉通常与Scaffold.drawer属性一起使用.抽屉的子项通常是ListView,其第一个子项是DrawerHeader ,它显示有关当前用户的状态信息.其余的 ...