WARNING: this is potentially destructive - deletes the current DB and creates a new one, so adapt to your needs BEFORE you try it
In one of my install scripts I found this note…
cd $HOME/frappe-bench;
erpnextSiteName="site1.local";
bench new-site $erpnextSiteName;
# You'll be then prompted to input your MySQL root password.
# IF this happens....
#ERROR 1045 (28000): Access denied for user '_8de49ae55a02e7ac'@'localhost' (using password: YES)
DBname=$(cat ~/frappe-bench/sites/$erpnextSiteName/site_config.json | awk '/db_name/ {print $2}' | sed "s/\"//g" | sed "s/,//g");
# delete the DB & site, and then retry
mysql -uroot -p$MySQLpwd -Bse "drop database $DBname;"
rm -fR $HOME/frappe-bench/sites/$erpnextSiteName;
bench new-site $erpnextSiteName;
# You'll also be prompted to create a new password for the System Administrator.
Check if your mariadb service is running and try creating a new site again.
sudo service mariadb start
If that still doesn’t fix it, then you might want to check on the mariadb installation.