
ERROR 2002 (HY000) Cant connect to local MySQL server through socket implies that the MySQL service is not running. Check the status of the MySQL service.
The ps command can be used to determine if your system is using init or systemd. If PID 1 is init, then you will use the service command. If PID 1 is systemd, then you will use the systemctl command.
If your system is using systemd, use the systemctl command to start and enable mysql.
systemctl enable mysql
systemctl start mysql
systemctl status mysql
If your system is using init, use the chkconfig and service commands to start and enable mysql.
chkconfig mysql on
service mysql start
service mysql status
SELinux may be enforcing. Use the following command to determine if SELinux is enforcing.
getenforce
If SELinux is enforcing, you can set SELinux to permissive to know if SELinux is the source of the problem.
setenforce permissive
Did you find this article helpful?
If so, consider buying me a coffee over at