About 31,100,000 results
Open links in new tab
  1. Can't connect to local MySQL server through socket '/var/mysql/mysql

    Mar 21, 2011 · A quick workaround that worked for me: try using the local ip address (127.0.0.1) instead of 'localhost' in mysql_connect (). This "forces" php to connect through TCP/IP instead of a unix socket.

  2. Solved: How to Fix 'Can't Connect to Local MySQL Server

    Nov 1, 2024 · A detailed guide on solving the 'Can't Connect to Local MySQL Server Through Socket' error, with multiple solutions and code examples to resolve the issue across various setups.

  3. MySQL :: MySQL 8.4 Reference Manual :: B.3.2.2 Can't connect to [local ...

    If the server is running on the local host, try using mysqladmin -h localhost variables to connect using the Unix socket file. Verify the TCP/IP port number that the server is configured to listen to (it is the …

  4. How to Fix 'Can't connect to local MySQL server through socket

    Aug 3, 2021 · In this tutorial, we will go over the potential causes of the 'Can't connect to local MySQL server through socket' error and show you different methods of resolving this issue.

  5. Why Can’t I Connect to Local MySQL Server Through Socket?

    Nov 30, 2025 · The inability to connect to a local MySQL server through a socket often stems from incorrect socket path configuration, the MySQL server not running, or insufficient permissions.

  6. How to fix ERROR 2002 (HY000): Can't connect to local MySQL server ...

    This error occurs when the MySQL client attempts to connect to a local MySQL server using a Unix socket file, but either the MySQL server is not running, the socket file doesn't exist, or the client …

  7. How to solve "Can't connect to local MySQL server through socket" …

    To resolve this, I removed the credentials out of the my.cnf option file in /etc/my.cnf and I create a .my.cnf option file in the home directory. For example /home/username/.my.cnf in Linux (replace …

  8. Fix ‘Can’t Connect to Local MySQL Server Through Socket’ Error: 6 …

    The “Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock'” error can stem from various configuration issues or service problems. By following these six solutions, you should be able to …

  9. Error 2002 (hy000): Can't connect to local MySQL server through socket ...

    Jun 29, 2023 · Learn how to fix the "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)" error and establish a successful connection.

  10. How To Troubleshoot Socket Errors in MySQL - DigitalOcean

    Mar 7, 2019 · There are a few reasons why this error may occur, and a few potential ways to resolve it. One common cause of this error is that the MySQL service is stopped or did not start to begin with, …