pt-table-sync --config and dsn specification

  • Filter
  • Time
  • Show
Clear All
new posts

  • pt-table-sync --config and dsn specification


    Is there a way to specify dsn in the config instead of on the command-line? I understand you can specify all _options_ in a config file that you can specify on the command line, but DSNs are not options, they are arguments. So is there a way to specify dsns in a config to pt-table-sync? I saw a couple references about this being possible, but I can't seem to figure out how it is possible from my brief viewing of the code.

    Why you ask? What am I trying to achieve?

    I'm attempting to run an automated pt-table-sync, providing two dsns, that have different usernames and passwords. It seems this would be a common thing? sync'ing a db/table using a ro account to a db/table with a rw account.

    I don't wish for the password to show up in a ps. This is a multi-user box and although the users are trusted, they do not all have the password nor should they. Auditors frown upon this as well.

    So my options are:
    1. Always modify pt-table-sync code to mask passwords in the DSN using $0 upon startup
    2. Find some way to specify the DSN in a config, where it is not passed to the cmdline.
    3. Build a new box and only provide access to those that have the password.

    I'm working on #2, as #1 is fraught with peril and #3 is also not-ideal.

    Apologizes if this was asked here before. I didn't see a search feature on the forum. I did to a google site search for the forum and only found the reference attached which seemed applicable. This is something I'm looking to do but I can't find any docs or code references about adding a DSN.

    As a side note, this box runs a couple of pt-table-sync's to differing databases, it has different creds to each box so having a global user/pass is not feasible. I need to specify a DSN per host.

    Thanks for any insight.

    - Mike
    mysql forum, mysql discussions, mysql question and answers, mysql meetup groups

  • #2
    Hi Mike,

    I had a discussion with out development team and they said that it's not possible to pass DSN as config file.
    And there is no workaround for this.

    So you can not do this: pt-table-sync [OPTIONS] --config-dsn1 <file> --config-dsn2 <file>

    Best, Michael