Question
mysqld: unrecognized service
Hi!
I have a problem with my MySQL server. I can’t connect to MySQL via command line. If I try it, I get:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
My directory /var/mysql is empty. And if I try
/etc/init.d/mysql restart
I get “[fail]”.
Moreover, if I type
service mysqld restart
I get “mysqld: unrecognized service”.
However, my website (which uses this database) works fine.
Thank you very much ;)
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
The service name is ‘mysql’ not 'mysqld’. Please confirm the status of the service by typing 'service mysql status’
Also you indicated that you check the /var/mysql directory, but the socket file should be located in /var/run/mysqld/ directory.