Is the MySQL server running?
from the Artful MySQL Tips List
Error 2002 "(HY000): Can't connect to local MySQL server ..." often means the server isnot running. Find out with ...
mysqladmin -uroot -p status
If it isn't, the mysql server log will probably show why.
Last updated 29 Mar 2020
the Artful MySQL Tips page