html output原理与应用

html output原理与应用   

html output:支持在线html height,可以并行执行html offset语句,而且主从复制延迟的时间非常少

    1.安装html output:

    html outputcd/server/tools/

    html outputrz上传工具包

    html outputtarzxfpercona-toolkit-3.2.1_x86_64.tar.gz解压工具包

    html outputmvpercona-toolkit-3.2.1/usr/local/pt移动并改名

    ```

    安装pt工具依赖:

    yum-yinstallperl-Digest-MD5

    yum-yinstallperl-DBI

    yum-yinstallperl-DBD-MySQL

    yum-yinstallperl-Time-HiRes

    yum-yinstallperl-IO-Socket-SSL

    ```

    html outputvim/etc/profile将pt目录加入到环境变量

    PATH="$PATH:/usr/local/mysql/bin:/usr/local/pt/bin"

    html output./etc/profile环境变量生效

    2.html output语法

   html output执行条件:操作的表必须是具有主键索引或唯一索引

html output--user=root--password=123456--socket=/data/mysql/mysql3306/mysql.sockD=db,t=t1--alter"addnamevarchar(10)notnull"--execute

    altertablet1addnamevarchar(10)notnull;

    --user指定用户

    --password=指定密码

    --socket指定socket文件

    D指定操作的数据库

    t指定操作的表

    --alter指定表结构变更命令

    --execute执行

    案例:

添加索引:

html output--user=root--password=123456--socket=/data/mysql/mysql3306/mysql.sockD=db,t=t1--alter"addindexi_name(name)"--execute

    altertablet1addindexi_name(name);

修改字段类型:

html output--user=root--password=123456--socket=/data/mysql/mysql3306/mysql.sockD=db,t=t1--alter"modifynamevarchar(30)notnull"--execute

    altertablet1modifynamevarchar(30)notnull;

Copyright & Disclaimer: If you find copyright issues, please provide relevant information and email us at [email protected], we will communicate promptly and handle removal.

Except for specially marked original content on abcdlink (https://www.abcdlink.com) all other content is reposted by users, and opinions/copyright are unrelated to this site.