Cannot connect to MySQL sever with MySQL Workbench
When you specify localhost as the host to connect to, the mysql commandline client tries to connect using a local socket. To enforce a tcp connection you have to either set the host to 127.0.0.1 or use the --protocol=tcp parameter.

Your server is not configured to accept network connections so you have to switch to change your connection method to Socket/Pipe Path and set the path to the socket, something like /var/run/mysqld/mysqld.sock. You can check yours in the config or by running select @@socket; in the commandline connection. \s used as command in the CLI will tell you that too and some more info about your server.