Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
MySql errors: "...Unit mysql.service not found." & "...Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)"
Whenever I give a command to MySQL, such as telling it to “start” or “restart”, I get this error:
Failed to start mysql.service: Unit mysql.service not found.
At other times (such as when I give the command “mysql”, I get this error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
I just can’t get past either of these errors. I tried all kinds of solutions online and so far none of them work.
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.×