Home >Database >Mysql Tutorial >MySQL Socket File Missing: How Do I Fix the 'Can't Connect Through Socket' Error?
MySQL Socket File Missing: Troubleshooting "Can't Connect Through Socket" Error
Unable to connect to MySQL with the following error:
'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Investigation:
Solution:
To resolve the issue, execute the following command to start the MySQL service:
sudo service mysql start
This will create the missing socket file, allowing MySQL connections to be established.
The above is the detailed content of MySQL Socket File Missing: How Do I Fix the 'Can't Connect Through Socket' Error?. For more information, please follow other related articles on the PHP Chinese website!