Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I try to log in to mysql using mysql -u root -p it gives me this error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I have looked in the directory and the file isn't there. I have looked around and people have said that sqld has to be running but I don't know how to start it.

share|improve this question
add comment

2 Answers

Usually, this should start your MySQL server:

/etc/init.d/mysqld start

Depending on which Linux distro you use, the command might be different.

share|improve this answer
    
i get this /etc/init.d/mysqld: No such file or directory when i enter that in. I also used service mysqld and that doesn't work. I am running Ubuntu 10.04 –  monkthemighty May 18 '12 at 21:49
1  
Have you installed MySQL server, even? sudo apt-get install mysql-server — it should start automatically after the installation is complete. –  slhck May 18 '12 at 21:51
add comment

Try /etc/init.d/mysql start, or if it has a different name than mysql, look for something that looks like it applies.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.