# OptionParser:921 4211 Description: pt-online-schema-change alters a table's structure without blocking reads or writes. Specify the database and table in the DSN. Do not use this tool before reading its documentation and checking your backups carefully.
# Usage: pt-online-schema-change [OPTIONS] DSN
# DSNParser:2246 4211 DSN string made from options: A=utf8,u=yearning_admin,p=****,h=172.16.0.11
For now, as a workaround use port as follows in your pt-online-schema-changes command, --host=172.16.0.11 D=sre_test,t=candles,P=3366 Will fix this bug in the Percona toolkit, and you can use the fixed version pt-osc binary in the toolkit you are using (like Yearning)
Till the time we are fixing this use the workaround method to mentioned mysql port.
pt-online-schema-change --alter "ADD COLUMN \`c_name\` VARCHAR(50) COMMENT '用户名'" --print --charset=utf8 --chunk-time 0.5 --critical-load Threads_connected:200,Threads_running:200 --max-load Threads_connected:250,Threads_running:250 --recurse=1 --check-interval 1 --no-check-replication-filters --alter-foreign-keys-method=rebuild_constraints --execute --statistics --max-lag=1 --no-version-check --recursion-method=processlist --progress percentage,1 --user="yearning_admin" --password="****" --host=172.16.0.11 --port=3366 D=sre_test,t=candles
The DEBUG message is
Then I change the options like this
It's OK,and the DEBUG message is
# OptionParser:921 4211 Description: pt-online-schema-change alters a table's structure without blocking reads or writes. Specify the database and table in the DSN. Do not use this tool before reading its documentation and checking your backups carefully.
# Usage: pt-online-schema-change [OPTIONS] DSN
# DSNParser:2246 4211 DSN string made from options: A=utf8,u=yearning_admin,p=****,h=172.16.0.11
# DSNParser:2186 4211 Parsing A=utf8,u=yearning_admin,p=****,h=172.16.0.11
# DSNParser:2205 4211 Finding value for S
# DSNParser:2215 4211 Copying value for S from defaults
# DSNParser:2205 4211 Finding value for F
# DSNParser:2215 4211 Copying value for F from defaults
# DSNParser:2205 4211 Finding value for A
# DSNParser:2205 4211 Finding value for P
# DSNParser:2215 4211 Copying value for P from defaults
# DSNParser:2205 4211 Finding value for u
# DSNParser:2205 4211 Finding value for p
# DSNParser:2205 4211 Finding value for h
# DSNParser:2205 4211 Finding value for D
# DSNParser:2215 4211 Copying value for D from defaults
# DSNParser:2205 4211 Finding value for t
# DSNParser:2215 4211 Copying value for t from defaults
# DSNParser:2299 4211 DBI:mysql:sre_test;host=172.16.0.11;port=3366;charset=utf8;mysql_read_default_group=client
# DSNParser:2348 4211 DBI:mysql:sre_test;host=172.16.0.11;port=3366;charset=utf8;mysql_read_default_group=client yearning_admin ***** mysql_enable_utf8=>1, ShowErrorStatement=>1, AutoCommit=>1, RaiseError=>1, PrintError=>0
# DSNParser:2377 4211 DBI::db=HASH(0x17c4858) /!40101 SET NAMES "utf8"/ # DSNParser:2382 4211 Enabling charset for STDOUT
# DSNParser:2529 4211 DBI::db=HASH(0x17c4858) SET SESSION innodb_lock_wait_timeout=1
# DSNParser:2529 4211 DBI::db=HASH(0x17c4858) SET SESSION lock_wait_timeout=60
# DSNParser:2529 4211 DBI::db=HASH(0x17c4858) SET SESSION wait_timeout=10000
# DSNParser:2397 4211 DBI::db=HASH(0x17c4858) SELECT @@SQL_MODE