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
    vi editor not working , insert and delete not working in ssh
    Viewed 3350 times since Wed, Jun 14, 2017
    Jump server ip to be licensed?
    Viewed 3004 times since Thu, Jun 15, 2017
    An error occurred while trying to submit the form
    Viewed 507 times since Tue, Feb 25, 2020
    unable to ssh because ip not allowed because none of user’s groups are listed in AllowGroups
    Viewed 11751 times since Thu, Jun 15, 2017
    How do i disable google 2 factor authentication or other 2factor mechanisms in the GUI?
    Viewed 6304 times since Wed, Jun 14, 2017
    LDAP verification failed. Connection to {hostname} closed.
    Viewed 1360 times since Fri, May 18, 2018
    Deleting entries in the mysql database table gwactivity_logs
    Viewed 192 times since Fri, Oct 30, 2020
    Disabling reCAPTCHA
    Viewed 3558 times since Wed, Jun 14, 2017
    Could not load style files while accessing Ezeelogin GUI
    Viewed 239 times since Thu, Dec 3, 2020
    function keys in htop command not working in putty
    Viewed 65 times since Fri, Feb 12, 2021