[root@localhost test]# pt-online-schema-change --host=192.168.0.107 --port=3306 --user=root --password=abc111111 --alter “MODIFY name VARCHAR(20) NOT NULL COMMENT ‘收货人’” D=neti,t=t_customer_address --print --execute
No slaves found. See --recursion-method if host localhost.localdomain has slaves.
Not checking slave lag because no slaves were found and --check-slave-lag was not specified.
Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client
is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER
possibly with SSL_ca_file|SSL_ca_path for verification.
If you really don’t want to verify the certificate and keep the
connection open to Man-In-The-Middle attacks please set
SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application.
at /usr/bin/pt-online-schema-change line 6982.
Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client
is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER
possibly with SSL_ca_file|SSL_ca_path for verification.
If you really don’t want to verify the certificate and keep the
connection open to Man-In-The-Middle attacks please set
SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application.
at /usr/bin/pt-online-schema-change line 6982.
Operation, tries, wait:
analyze_table, 10, 1
copy_rows, 10, 0.25
create_triggers, 10, 1
drop_triggers, 10, 1
swap_tables, 10, 1
update_foreign_keys, 10, 1
Altering neti
.t_customer_address
…
Creating new table…
CREATE TABLE neti
._t_customer_address_new
(id
int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT ‘??’,customer_id
int(10) unsigned NOT NULL COMMENT ‘??ID’,name
varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT ‘??’,tel
char(11) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT ‘??’,address
varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT ‘??’,prime
tinyint(1) NOT NULL COMMENT ‘???’,is_deleted
tinyint(1) NOT NULL DEFAULT ‘0’ COMMENT ‘???’,
PRIMARY KEY (id
) USING BTREE,
KEY idx_customer_id
(customer_id
) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT=’???'
Created new table neti._t_customer_address_new OK.
Altering new table…
ALTER TABLE neti
._t_customer_address_new
MODIFY name VARCHAR(20) NOT NULL COMMENT '收货人’
Altered neti
._t_customer_address_new
OK.
2020-03-27T23:12:27 Creating triggers…
2020-03-27T23:12:27 Created triggers OK.
2020-03-27T23:12:27 Copying approximately 3 rows…
INSERT LOW_PRIORITY IGNORE INTO neti
._t_customer_address_new
(id
, customer_id
, name
, tel
, address
, prime
, is_deleted
) SELECT id
, customer_id
, name
, tel
, address
, prime
, is_deleted
FROM neti
.t_customer_address
LOCK IN SHARE MODE /pt-online-schema-change 1447 copy table/
2020-03-27T23:12:27 Copied rows OK.
2020-03-27T23:12:27 Analyzing new table…
2020-03-27T23:12:27 Swapping tables…
RENAME TABLE neti
.t_customer_address
TO neti
._t_customer_address_old
, neti
._t_customer_address_new
TO neti
.t_customer_address
2020-03-27T23:12:27 Swapped original and new tables OK.
2020-03-27T23:12:27 Dropping old table…
DROP TABLE IF EXISTS neti
._t_customer_address_old
2020-03-27T23:12:27 Dropped old table neti
._t_customer_address_old
OK.
2020-03-27T23:12:27 Dropping triggers…
DROP TRIGGER IF EXISTS neti
.pt_osc_neti_t_customer_address_del
DROP TRIGGER IF EXISTS neti
.pt_osc_neti_t_customer_address_upd
DROP TRIGGER IF EXISTS neti
.pt_osc_neti_t_customer_address_ins
2020-03-27T23:12:27 Dropped triggers OK.
Successfully altered neti
.t_customer_address
.