--------------------------------------------安装---------------------
[root@host01 percona]# tar -xvf percona-toolkit-3.0.3_x86_64.tar.gz
[root@host01 percona]# mv percona-toolkit-3.0.3 /opt/
[root@host01 percona-toolkit-3.0.3]#perl Makefile.PL
[root@host01 percona-toolkit-3.0.3]#yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker -y
[root@host01 percona-toolkit-3.0.3]#perl Makefile.PL
[root@host01 percona-toolkit-3.0.3]# make
[root@host01 percona-toolkit-3.0.3]# make install
发现3.0.3版本安装好了之后有问题
./pt-online-schema-change -h localhost -uroot -pmysql --socket=/tmp/mysql.sock --alter='add column createtime datetime' D=oss03,t=tb_id --execute
执行包如下错误:
Use of uninitialized value in printf at ./pt-online-schema-change line 8489
后来我换了个2.2.20版本,就没有出现这个问题.
问题1:
Can't locate Time/HiRes.pm in @INC
解决办法:
yum install perl-Time-HiRes -y
问题2:
Cannot connect to MySQL: Cannot connect to MySQL because the Perl DBD::mysql module is not installed or not found
解决办法:
yum install perl-DBI
yum install perl-DBD-MySQL
yum install perl-Time-HiRes
yum install perl-IO-Socket-SSL
问题3:
You do not have the PROCESS privilege at ./pt-online-schema-change line 4421.
grant all privileges on *.* to 'root'@'192.168.1.85';
flush privileges;
问题4:
Can't use an undefined value as an ARRAY reference at ./pt-online-schema-change line 7547.
解决办法:
在命令上添加如下选项
--no-version-check
---------------自定义路径安装--------------------------
[root@localhost soft]# tar -xvf percona-toolkit-3.1.0_x86_64.tar.gz
[root@localhost soft]# mkdir -p /opt/percona-toolkit
[root@localhost soft]# perl Makefile.PL PREFIX=/opt/percona-toolkit
[root@host01 percona-toolkit-3.0.3]# make
[root@host01 percona-toolkit-3.0.3]# make install