At the moment it is not possible to configure / use a socket to connect with the database. mysqli supports connection via socket:
Description
Description
Event Timeline
Comment Actions
It's not something we'll support given the cost and lack of interest. You can either fork and provide the feature for your local install or use a supported method of connection. To be honest, this is the first request I've seen in 5 years.