We are able to connect mysql db in mysql probe but getting the error Can't connect to local MySQL server through socket.
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,
<sample_connection>
username = sample_user
password =
description = sample connection
address = localhost
retry_attempts = 3
retry_delay = 5 sec
port_number = 3306
option = 2
path = /var/lib/mysql/mysql.sock
</sample_connection>
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.
https://dev.mysql.com/doc/refman/8.0/en/problems-with-mysql-sock.html
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.