ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2) with MariaDB & MySQL

That sounds reasonable - service files aren’t “meant” to be edited, so won’t be in the PKGBUILD’s backup array (also linked below).

systemctl edit mariadb is a good way to override elements of a unit’s behaviour which won’t be removed when the service file is upgraded.