Install MariaDb server on Raspberry Pi
First, update the system
sudo apt-get update && apt-get upgrade
Run the command to install the necessary packages
sudo apt-get install mariadb-server
Run the following command to secure the Server installation
sudo mysql_secure_installation
When requested, enter a password for the ‘root’ user. Then, to all questions, answer by Y (Yes) for securing the system.
Then, to access the Database Server, just run the following command:
mysql -u root -p : system will ask to enter the root user password
or
mysql -u root -ppassword : (where password is the password of the root user)