Control Compliance Suite (CCS) MySQL data collection error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

book

Article ID: 210706

calendar_today

Updated On:

Products

Control Compliance Suite Standards Database Control Compliance Suite Control Compliance Suite Standards Server Control Compliance Suite Unix Control Compliance Suite Windows

Issue/Introduction

When running a data collection job for MySQL you receive the following error.

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Cause

Either that file does not exist (mysqld is not running), or has been moved to a different location than the default.

Resolution

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 in a global or local option file. For example, put the following lines in /etc/my.cnf:

 
[mysqld]
socket=/path/to/socket

[client]
socket=/path/to/socket