unix sockets are a file type object that unix programs can communicate over - so the server creates a socket in the directory quoted in the error, and listens to that socket for connections, clients on the local machine can then connect to the socket to talk to the server, this only works if both processes are on the local machine, eg if you are connecting to localhost as the hostname in mysql.
If MySQL has a connection from a remote computer, it uses tcp connections, which have more overhead then unix sockets (not much, but it can make a diffence when you run a busy webserver connecting to localhost).
Your error seems to indicate that either the server is already running - check the socket exists already:
and see if the file mysql.sock exists (and check it is a socket)
if it does exist - you might already be running mysql
[code]ps auxhw |grep mysql[code]
will show a mysql process if it is running
if it does not exist, check the user running mysql (mysql or nobody) has write permission to the directory the socket is created in (/opt/lampp/var/mysql/) and that the directory exists.
If these fail, post back with the output of:
ls -la /opt/lampp/var/mysql
and the user you are running mysql as (probably in mysql config file)
as this will help to verify the problem