0

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?

0

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.

  • 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
  • Please did you put any password for your MySQL user? – Yufenyuy Veyeh Dider Feb 8 '18 at 17:55

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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