Update system packages
sudo apt update && sudo apt upgrade -y
Install additional dependencies
sudo apt-get install wget software-properties-common dirmngr ca-certificates apt-transport-https -y
Import MariaDB GPG key
sudo wget -O- https://mariadb.org/mariadb_release_signing_key.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mariadb.gpg
Add MariaDB repository(Here to check version)
echo deb [arch=amd64,arm64,ppc64el,s390x signed-by=/usr/share/keyrings/mariadb.gpg] http://mirror.mariadb.org/repo/11.2.3/ubuntu/ jammy main | sudo tee /etc/apt/sources.list.d/mariadb.list
Update system packages
sudo apt update
Install MariaDB
sudo apt install mariadb-server mariadb-client -y
Check status of MariaDB
systemctl status mariadb
Set MariaDB(依據需求回答即可,畫面僅供參考,並非一定要這樣回答)
sudo mysql_secure_installation
test
sudo mysql -u root -p