this is what the debug command gives,
$ sudo pmm-admin add mysql --query-source=perfschema --username=pmm --password=pass --service-name=MYSQL_NODE --debug
DEBUG 2022-06-03 06:20:45.66670904Z: POST /local/Status HTTP/1.1
Host: 127.0.0.1:7777
User-Agent: Go-http-client/1.1
Content-Length: 3
Accept: application/json
Content-Type: application/json
Accept-Encoding: gzip
{}
DEBUG 2022-06-03 06:20:45.668959968Z: HTTP/1.1 200 OK
Content-Length: 792
Content-Type: application/json
Date: Fri, 03 Jun 2022 06:20:45 GMT
Grpc-Metadata-Content-Type: application/grpc
{
"agent_id": "/agent_id/30b8ee49-55b6-4092-bd27-1a7dbcc27dce",
"runs_on_node_id": "/node_id/411301f1-fc15-4468-a045-de38e6eb7379",
"server_info": {
"url": "https://admin:admin@X.X.X.X:443/",
"insecure_tls": true,
"connected": true,
"version": "2.28.0",
"latency": null,
"clock_drift": null
},
"agents_info": [
{
"agent_id": "/agent_id/17227ca7-ef32-4c32-ab9c-8bf0b000cc45",
"agent_type": "VM_AGENT",
"status": "RUNNING",
"listen_port": 42000
},
{
"agent_id": "/agent_id/790765b0-a95b-4ecf-954c-a161afe9bba5",
"agent_type": "NODE_EXPORTER",
"status": "RUNNING",
"listen_port": 42001
}
],
"config_filepath": "/usr/local/percona/pmm2/config/pmm-agent.yaml",
"agent_version": "2.28.0"
}
DEBUG 2022-06-03 06:20:45.669262661Z: POST /local/Status HTTP/1.1
Host: 127.0.0.1:7777
User-Agent: Go-http-client/1.1
Content-Length: 3
Accept: application/json
Content-Type: application/json
Accept-Encoding: gzip
{}
DEBUG 2022-06-03 06:20:45.669831109Z: HTTP/1.1 200 OK
Content-Length: 792
Content-Type: application/json
Date: Fri, 03 Jun 2022 06:20:45 GMT
Grpc-Metadata-Content-Type: application/grpc
{
"agent_id": "/agent_id/30b8ee49-55b6-4092-bd27-1a7dbcc27dce",
"runs_on_node_id": "/node_id/411301f1-fc15-4468-a045-de38e6eb7379",
"server_info": {
"url": "https://admin:admin@X.X.X.X:443/",
"insecure_tls": true,
"connected": true,
"version": "2.28.0",
"latency": null,
"clock_drift": null
},
"agents_info": [
{
"agent_id": "/agent_id/17227ca7-ef32-4c32-ab9c-8bf0b000cc45",
"agent_type": "VM_AGENT",
"status": "RUNNING",
"listen_port": 42000
},
{
"agent_id": "/agent_id/790765b0-a95b-4ecf-954c-a161afe9bba5",
"agent_type": "NODE_EXPORTER",
"status": "RUNNING",
"listen_port": 42001
}
],
"config_filepath": "/usr/local/percona/pmm2/config/pmm-agent.yaml",
"agent_version": "2.28.0"
}
DEBUG 2022-06-03 06:20:45.670142639Z: POST /v1/management/MySQL/Add HTTP/1.1
Host: 10.57.58.215:443
User-Agent: Go-http-client/1.1
Content-Length: 325
Accept: application/json
Authorization: Basic YWRtaW46YWRtaW4=
Content-Type: application/json
Accept-Encoding: gzip
{"node_id":"/node_id/411301f1-fc15-4468-a045-de38e6eb7379","service_name":"MYSQL_NODE","address":"127.0.0.1","port":3306,"pmm_agent_id":"/agent_id/30b8ee49-55b6-4092-bd27-1a7dbcc27dce","username":"pmm","password":"pass","qan_mysql_perfschema":true,"max_slowlog_file_size":"0","metrics_mode":"AUTO","disable_collectors":null}
DEBUG 2022-06-03 06:20:45.692229551Z: HTTP/1.1 400 Bad Request
Content-Length: 247
Connection: keep-alive
Content-Type: application/json
Date: Fri, 03 Jun 2022 06:20:45 GMT
Server: nginx
{
"error": "Connection check failed: Error 1045: Access denied for user 'pmm'@'localhost' (using password: YES).",
"code": 9,
"message": "Connection check failed: Error 1045: Access denied for user 'pmm'@'localhost' (using password: YES)."
}
DEBUG 2022-06-03 06:20:45.692397734Z: Result: <nil>
DEBUG 2022-06-03 06:20:45.692444892Z: Error: &my_sql.AddMySQLDefault{_statusCode:400, Payload:(*my_sql.AddMySQLDefaultBody)(0xc000335c00)}
Connection check failed: Error 1045: Access denied for user 'pmm'@'localhost' (using password: YES).