If you specify your MySQL server as "localhost" in your config.php file it will connect through a UNIX socket.
To check, run mysqladmin version and it'll tell you (here's what my server says):
Server version 5.5.28-29.2-log
Protocol version 10 Connection Localhost via UNIX socket
UNIX socket /var/run/mysqld/mysqld.sock
Uptime: 15 days 3 hours 17 min 32 sec