in this Linux tutorial you will see how to install Mariadb on Debian. In this tutorial we are using Debian 12.5 but it the process should be the same on Debian 12.
The commands i use in this tutorial are:
sudo apt update
sudo apt upgrade
sudo apt show mariadb-server
sudo apt install mariadb-server -y
sudo mariadb-secure-installation
sudo systemctl status mariadb
sudo mariadb