We are able to connect mysql db in mysql probe but getting the error Can't connect to local MySQL server through socket.
Release : 20.3
Component : UIM MYSQL
It seems to be the sample connection that is generating that alarm, you don't need it, its just an example, so you can disable it or delete it and use your own and specify the host or IP address,
username = sample_user
description = sample connection
address = localhost
retry_attempts = 3
retry_delay = 5 sec
port_number = 3306
option = 2
path = /var/lib/mysql/mysql.sock
From the mysql techdocs:
Verify if you can connect using the ipaddress instead of the hostname.
Make sure that mysqld is running. Update the MySQL client config.
Specify the path to the socket in a global or local option file and make sure that the path specified in the probe is updated.