Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

1 Answer

The file is called

/etc/init.d/mysql

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
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.