We help IT Professionals succeed at work.
Get Started

can't open mysql

kennethmurrah
on
70 Views
Last Modified: 2016-06-21
I've had this server running for years but suddenly i get the error

'/var/run/mysqld/mysqld.sock' (2)

when I try to run my website which accesses the mysql server.

If I log into the server and try to log in to msqyl, I get a similar error.


web:~# mysql -u root
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
web:~#


I tried to locate a socket that was open, but the mysql did not appear to be open:
/var/spool/postfix/private/rewrite
/var/spool/postfix/private/bounce
/var/spool/postfix/private/defer
/var/spool/postfix/private/trace
/var/spool/postfix/private/verify
/var/spool/postfix/private/proxymap
/var/spool/postfix/private/smtp
/var/spool/postfix/private/relay
/var/spool/postfix/private/error
/var/spool/postfix/private/local
/var/spool/postfix/private/virtual
/var/spool/postfix/private/lmtp
/var/spool/postfix/private/anvil
/var/spool/postfix/private/maildrop
/var/spool/postfix/private/uucp
/var/spool/postfix/private/ifmail
/var/spool/postfix/private/bsmtp
/var/spool/postfix/private/scalemail-backend
/var/spool/postfix/public/cleanup
/var/spool/postfix/public/flush
/var/spool/postfix/public/showq
/dev/log
/dev/printer


THEN i tried to see if mysql was running and to start it:
web:~# ps aux | grep mysqlps aux | grep mysql
grep: aux: No such file or directory
web:~# /etc/init.d/mysql start
Starting MySQL database server: mysqld...failed.
        Please take a look at the syslog.
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!


I have no idea where to go now ...

thanks in advance.
Comment
Watch Question
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE