Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .