Skip to content
This repository was archived by the owner on Jun 1, 2022. It is now read-only.

PMM-4879 Added support for defaultsfile parameter.#199

Open
pkadej wants to merge 11 commits intopercona:mainfrom
pkadej:PMM-4879-defaults-file
Open

PMM-4879 Added support for defaultsfile parameter.#199
pkadej wants to merge 11 commits intopercona:mainfrom
pkadej:PMM-4879-defaults-file

Conversation

@pkadej
Copy link
Contributor

@pkadej pkadej commented Apr 8, 2022

PMM-4879

Build: SUBMODULES-2465

Build will fail because I cannot use forked version of api (pmm) as dependency in mod.go. To acomplish this, api needs be merged and version of pmm api should be bumped.

@it-percona-cla
Copy link

it-percona-cla commented Apr 8, 2022

CLA assistant check
All committers have signed the CLA.

@ritbl
Copy link
Contributor

ritbl commented Apr 18, 2022

Checked, and it doesn't work

➜  pmm-admin git:(PMM-4879-defaults-file) ✗ pmm-admin add mysql  --defaults-file=~/.my.cnf              
Connection check failed: Error 1045: Access denied for user 'root'@'172.30.0.1' (using password: NO).
➜  pmm-admin git:(PMM-4879-defaults-file) ✗ cat ~/.my.cnf 
[client]
host=127.0.0.1
port=12345
user=root
password=root-password

with explicit creds works just fine:

➜  pmm-admin git:(PMM-4879-defaults-file) ✗ pmm-admin add mysql --username=root --password=root-password
MySQL Service added.
Service ID  : /service_id/5972faf9-5bd1-403a-9ea6-661bcee16234
Service name: prime-u1-mysql

Table statistics collection enabled (the limit is 1000, the actual table count is 298).

@pkadej
Copy link
Contributor Author

pkadej commented Apr 20, 2022

Checked, and it doesn't work

➜  pmm-admin git:(PMM-4879-defaults-file) ✗ pmm-admin add mysql  --defaults-file=~/.my.cnf              
Connection check failed: Error 1045: Access denied for user 'root'@'172.30.0.1' (using password: NO).
➜  pmm-admin git:(PMM-4879-defaults-file) ✗ cat ~/.my.cnf 
[client]
host=127.0.0.1
port=12345
user=root
password=root-password

with explicit creds works just fine:

➜  pmm-admin git:(PMM-4879-defaults-file) ✗ pmm-admin add mysql --username=root --password=root-password
MySQL Service added.
Service ID  : /service_id/5972faf9-5bd1-403a-9ea6-661bcee16234
Service name: prime-u1-mysql

Table statistics collection enabled (the limit is 1000, the actual table count is 298).

Local pmm-manage server need to be rebuild, e.g.:

make env TARGET=run-debug

@pkadej pkadej marked this pull request as ready for review April 20, 2022 09:44
@pkadej pkadej requested a review from BupycHuk as a code owner April 20, 2022 09:44
AddMySQLC.Flag("node-id", "Node ID (default is autodetected)").StringVar(&AddMySQL.NodeID)
AddMySQLC.Flag("pmm-agent-id", "The pmm-agent identifier which runs this instance (default is autodetected)").StringVar(&AddMySQL.PMMAgentID)

AddMySQLC.Flag("username", "MySQL username").Default("root").StringVar(&AddMySQL.Username)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And for username let's use the same logic as for default address.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

@pkadej
Copy link
Contributor Author

pkadej commented Apr 28, 2022

This will fail for sure, linter doesnt allow to use replace with forked pmm/api:

go.mod:7:1: replacement are not allowed: github.com/percona/pmm (gomoddirectives)
replace github.com/percona/pmm => github.com/pkadej/pmm v0.0.0-20220427173424-9aa771bbf8c1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants