Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

I'm trying to get a lamp server running on my ubuntu installation. I have SSH and Apache working without any problems.

I installed MySQL with sudo apt-get install mysql-server mysql-client

As usual with proir installations i've done it asked for a password. And looked like everything was fine. Except when i tried to test it out. mysql -u root -p Error Can't connect to local mysql server through socket /var/run/mysqld/mysqld.sock

I went to the file location and there was no mysqld.sock file. I googled around for a while, and one response was to restart via /etc/init.d/mysqld restart.

there's no mysqld file in my init.d folder either!!?? What's going on here? Any suggestions? How can i install and reinstall mysql? Is there some reason that the mysql service isn't installing?

share|improve this question

The file is called


not mysqld.

You can use also

sudo service mysql restart

Check afterwards if MySQL is running: you can use e.g. top or htop or run ps -aux|grep mysql.

share|improve this answer
Yeah, messed up on the question. It's a fresh install of mysql. service mysql start works okay, but mysql doesn't start. grep returns root 7008 5892 0 14:19 pts/1 00:00:00 grep --color=auto mysql and mysql -u root -p returns ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) – Seiche Oct 22 '12 at 13:20

Your Answer


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.