Oracle 系统管理 - Linux 系统 - Backtrack 5 - 安全 - Juniper 技术 - Cisco 技术 - 思科模拟器 - Cisco 认证 - Cisco ios 下载

您现在的位置是:Docker > Centos > Centos MySQL工具Percona Toolkit

Centos MySQL工具Percona Toolkit

时间:2018-05-21 15:49  来源:未知  阅读次数: 复制分享 我要评论

安装Percona Toolkit 的Repo 得以支持直接用yum 安装二进制包

 

改MySQL表结构DDL pt-online-schema-change

D=database 库名
t=table 表名
–alter=’add column vid int ‘ 要执行的语句

注意:
mysql版本5.5 数据库和表都是utf8编码,
表的字段注释维中文
在执行 pt-online-schema-change的时候一定的加参数 -A=utf-8

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Operation, tries, wait:
copy_rows, 10, 0.25
create_triggers, 10, 1
drop_triggers, 10, 1
swap_tables, 10, 1
update_foreign_keys, 10, 1
Altering `wwek`.`wwek_users`...
Creating new table...
Created new table wwek._wwek_users_new OK.
Altering new table...
Altered `wwek`.`_wwek_users_new` OK.
2015-09-18T10:56:16 Creating triggers...
2015-09-18T10:56:16 Created triggers OK.
2015-09-18T10:56:16 Copying approximately 183066 rows...
Copying `wwek`.`wwek_users`: 30% 01:10 remain
Copying `wwek`.`wwek_users`: 49% 01:01 remain
Copying `wwek`.`wwek_users`: 63% 00:51 remain
Copying `wwek`.`wwek_users`: 76% 00:37 remain
Copying `wwek`.`wwek_users`: 88% 00:20 remain
2015-09-18T10:59:03 Copied rows OK.
2015-09-18T10:59:03 Swapping tables...
2015-09-18T10:59:03 Swapped original and new tables OK.
2015-09-18T10:59:03 Dropping old table...
2015-09-18T10:59:04 Dropped old table `wwek`.`_wwek_users_old` OK.
2015-09-18T10:59:04 Dropping triggers...
2015-09-18T10:59:04 Dropped triggers OK.
Successfully altered `wwek`.`wwek_users`.
相关资讯