Uploaded image for project: 'Percona Toolkit'
  1. Percona Toolkit
  2. PT-1911

pt-online-schema-change can't use options port

    XMLWordPrintable

    Details

      Description

       

      
      

      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

       

      # OptionParser:921 4190 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 4190 DSN string made from options: A=utf8,P=3366,u=yearning_admin,p=****,h=172.16.0.11
      # DSNParser:2186 4190 Parsing A=utf8,P=3366,u=yearning_admin,p=****,h=172.16.0.11
      # DSNParser:2205 4190 Finding value for S
      # DSNParser:2215 4190 Copying value for S from defaults
      # DSNParser:2205 4190 Finding value for F
      # DSNParser:2215 4190 Copying value for F from defaults
      # DSNParser:2205 4190 Finding value for A
      # DSNParser:2205 4190 Finding value for P
      # DSNParser:2205 4190 Finding value for u
      # DSNParser:2205 4190 Finding value for p
      # DSNParser:2205 4190 Finding value for h
      # DSNParser:2205 4190 Finding value for D
      # DSNParser:2215 4190 Copying value for D from defaults
      # DSNParser:2205 4190 Finding value for t
      # DSNParser:2215 4190 Copying value for t from defaults
      # DSNParser:2299 4190 DBI:mysql:sre_test;host=172.16.0.11;charset=utf8;mysql_read_default_group=client
      # DSNParser:2348 4190 DBI:mysql:sre_test;host=172.16.0.11;charset=utf8;mysql_read_default_group=client yearning_admin **** mysql_enable_utf8=>1, ShowErrorStatement=>1, AutoCommit=>1, RaiseError=>1, PrintError=>0
      # DSNParser:2348 4190 DBI:mysql:sre_test;host=172.16.0.11;charset=utf8;mysql_read_default_group=client yearning_admin **** mysql_enable_utf8=>1, ShowErrorStatement=>1, AutoCommit=>1, RaiseError=>1, PrintError=>0
      Cannot connect to MySQL: DBI connect('sre_test;host=172.16.0.11;charset=utf8;mysql_read_default_group=client','yearning_admin',...) failed: Can't connect to MySQL server on '172.16.0.11' (111) at /usr/bin/pt-online-schema-change line 2350.

       

      Then I change the options like this

       

      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 D=sre_test,t=candles,P=3366

       

      It's OK,and the DEBUG message is

      
      
      1. # 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.
      2. # Usage: pt-online-schema-change [OPTIONS] DSN
      3. # DSNParser:2246 4211 DSN string made from options: A=utf8,u=yearning_admin,p=****,h=172.16.0.11
      4. # DSNParser:2186 4211 Parsing A=utf8,u=yearning_admin,p=****,h=172.16.0.11
      5. # DSNParser:2205 4211 Finding value for S
      6. # DSNParser:2215 4211 Copying value for S from defaults
      7. # DSNParser:2205 4211 Finding value for F
      8. # DSNParser:2215 4211 Copying value for F from defaults
      9. # DSNParser:2205 4211 Finding value for A
      10. # DSNParser:2205 4211 Finding value for P
      11. # DSNParser:2215 4211 Copying value for P from defaults
      12. # DSNParser:2205 4211 Finding value for u
      13. # DSNParser:2205 4211 Finding value for p
      14. # DSNParser:2205 4211 Finding value for h
      15. # DSNParser:2205 4211 Finding value for D
      16. # DSNParser:2215 4211 Copying value for D from defaults
      17. # DSNParser:2205 4211 Finding value for t
      18. # DSNParser:2215 4211 Copying value for t from defaults
      19. # DSNParser:2299 4211 DBI:mysql:sre_test;host=172.16.0.11;port=3366;charset=utf8;mysql_read_default_group=client
      20. # 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
      21. # DSNParser:2377 4211 DBI::db=HASH(0x17c4858) /!40101 SET NAMES "utf8"/ # DSNParser:2382 4211 Enabling charset for STDOUT
      22. # DSNParser:2529 4211 DBI::db=HASH(0x17c4858) SET SESSION innodb_lock_wait_timeout=1
      23. # DSNParser:2529 4211 DBI::db=HASH(0x17c4858) SET SESSION lock_wait_timeout=60
      24. # DSNParser:2529 4211 DBI::db=HASH(0x17c4858) SET SESSION wait_timeout=10000
      25. # DSNParser:2397 4211 DBI::db=HASH(0x17c4858) SELECT @@SQL_MODE

        Attachments

        1. use_P.log
          55 kB
        2. use_port.log
          36 kB

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            binger binger
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:

                Smart Checklist