Can’t connect to local MySQL server through socket /tmp/mysql.sock

Failed to connect to database: Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2). . An error occurred. Please contact administrator..


Can’t connect to local MySQL server through socket ’3306 ’ in ezsh.log 

 
Edit the file "/usr/local/etc/ezlogin/ez.conf" and correct the variable

db_port <path to the mysql socket file found using the command below>

mysql -e "show variables like 'socket';"

Usually it would be /var/lib/mysql/mysql.sock but varies from server to server.

The command above would show the path to the mysql socket file that is current in use, else you would need to setup them in the mysql configuration file usually found in /etc/my.cnf.

You would need to make sure that the mysql sock does exist in the path specified in /usr/local/etc/ezlogin/ez.conf

0 (0)
Article Rating (No Votes)
Rate this article
    Attached Files
    There are no attachments for this article.
    Related Articles RSS Feed
    key_read: uudecode ssh user cant login with ssh key
    Viewed 3865 times since Thu, Jun 15, 2017
    Token not found in Cpanel/WHM
    Viewed 3202 times since Wed, Jun 14, 2017
    stdin: is not a tty TERM Environment variable not set error
    Viewed 772 times since Fri, Jul 20, 2018
    "Error: LDAP extension is not installed".
    Viewed 2076 times since Fri, Sep 8, 2017
    Error: Server login failed. sh: /usr/local/ezlogin/ezutil: Permission denied
    Viewed 1823 times since Wed, Jun 14, 2017
    How to search using IP or other fields instead of host name in jump server ssh interface or gui?
    Viewed 1035 times since Fri, May 4, 2018
    The IP field must contain a valid public IP or how to install Ezeelogin on a machine in lan
    Viewed 2499 times since Wed, Jun 14, 2017
    Primary node showing the public ip instead of lan ip when cluster is configured
    Viewed 413 times since Wed, Nov 21, 2018
    How do i disable google 2 factor authentication or other 2factor mechanisms?
    Viewed 3255 times since Wed, Jun 14, 2017
    502 on login with nginx
    Viewed 1906 times since Wed, Jun 14, 2017