Can not reset MariaDB password "can't connect to local MySQL server through socket"
This is because mysqld_safe silently fails if it doesn't have permissions and it can't write to the log as in the event of being run as a regular user.

Instead run,

sudo mysqld_safe --skip-grant-tables &amp;