[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!
Using following command I checked the mysql directory.
[root@localhost ~]# ll /var/lib/mysql/
I did not found the mysql.sock file there.
[root@localhost ~]# cd /var/lib/mysql/
Created file in that location.
[root@localhost mysql]# touch mysql.sock
Gave the executabe permission the sock file.
[root@localhost mysql]# chmod +x mysql.sock
Changed the permission to mysql user
[root@localhost mysql]# chown mysql:mysql -R *
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.
I Purab am from India, Pune. I am WordPress and Drupal Architect and consultant. I worked on many technologies like Ruby on Rails, Flex, PHP, jQuery etc...
Senior Technical Lead at Smartsourcing Global Pvt Ltd in Princeton, NJ, USA.
I contributed to many wordpress plugins and Drupal Modules. I contributed to Drupal core also.
Connect to purab on LinkedIn or
Follow @purab on Twitter or
Follow me on Google+ or
Write Mail to
Chat with me on Skype : purabdk