Jetzt einen VPS bestellen!

InfrawireInfrawire LogoDokumentation
Appeler

MariaDB auf Linux-VPS installieren

MariaDB für Web-Apps auf Ihrem Linux-VPS.

📋 Voraussetzungen

  • Ubuntu 22.04+ or Debian 11+ Linux VPS with sudo
  • At least 1 GB RAM (2 GB recommended for production)
  • Open app ports in UFW if remote DB access is needed

Install MariaDB

Bash
sudo apt update sudo apt install -y mariadb-server sudo systemctl enable --now mariadb

Secure the install

Set root password, remove anonymous users, disable remote root, drop test DB if unused.

Bash
sudo mariadb-secure-installation

Create database and user

Bash
sudo mariadb -e "CREATE DATABASE myapp CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" sudo mariadb -e "CREATE USER 'myapp'@'localhost' IDENTIFIED BY 'StrongPassword!';" sudo mariadb -e "GRANT ALL PRIVILEGES ON myapp.* TO 'myapp'@'localhost';" sudo mariadb -e "FLUSH PRIVILEGES;"

Verify

Bash
sudo mariadb -u myapp -p myapp -e "SHOW TABLES;"

Viel Erfolg! 🚀