Reinstallation of mariadb server and database setup

I am using ERPNEXT PRODUCTION setup on ORACLE VM. While doing some troubleshooting I accidentally deleted mariadb server. As there are other things installed on the server I wish to reinstall and reconfigure mariadb server along with ERPNEXT database (from scratch). I will be grateful if someone can help me out on this

You can easily reinstall mariadb based on your OS, yum/apt-get install mariadb ? Where are you stuck?

thanks for quick reply. I did this but still it gives me an error. I think I need to purge mariadb and reinstall. The help that I am looking for is how I can reconfigure database from scratch. This is new setup and there is no backup