[root@localhost ~]# mysqladmin -u root shutdown mysqladmin: connect to server at ‘localhost’ failed error: ‘Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)’ Check that mysqld is running and that the socket: ‘/var/lib/mysql/mysql.sock’ exists!
Solved issue: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock
Using following command I checked the mysql directory. [root@localhost ~]# ll /var/lib/mysql/
Solution is Hidden! It's Visible for Users who Liked/Shared This article on Facebook or Twitter or Google+. Like or Tweet this article to reveal the content.
After that restarted the machine [root@localhost mysql]# /etc/init.d/mysqld start Starting mysqld: [ OK ] [root@localhost mysql]# mysql -uroot Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.1.52 MySQL Community Server (GPL) by Remi
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL v2 license
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql> show databases;
Can’t connect to local MySQL server through socket
My name is Purab Kharat, Here is my Personal Blog: wpapi.com. Work as an Senior Technical Lead at Smartsourcing Global Pvt Ltd in Princeton, NJ, USA. I contributor of many wordpress plugins and Drupal Modules. I am core developer of Drupal. Connect to on LinkedIn or Follow @purab on Twitter or Follow me on Google+ or Write Mail to email@example.com or Chat with me on Skype : purabdk