UNIX socket connection to MariaDB/MySQL?

It looks like ERPNext setup doesn’t recognize MariaDB running without network only via UNIX socket file. The config is:

socket = /run/mysqld/mysqld.sock

Unfortunately, $ bench new-site site1.local asks for root password, but results in:

pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'localhost' ([Errno 97] Address family not supported by protocol)")

Another user asked for help 2017, but his/her Can’t connect to local MySQL server through socket solution doesn’t work anymore. As MariaDB 10.4.x will launch with socket connection by default, solving this would be highly appreciated.

That would probably require changes on the bench/frappe side of things, I suggest you make an issue on the github repository for this to be implemented.