How to install MySQL or MariaDB
Only needed for the MySQL / MariaDB edition. The standard edition uses PostgreSQL.
You need one of them: MySQL 8.0+ or MariaDB 10.6+.
Linux (Ubuntu / Debian)
MariaDB
sudo apt update
sudo apt install -y mariadb-server
sudo systemctl enable --now mariadb
sudo mariadb-secure-installation
MySQL
sudo apt update
sudo apt install -y mysql-server
sudo systemctl enable --now mysql
sudo mysql_secure_installation
On Ubuntu and Debian the mysql-server and mariadb-server packages can't be installed at the same
time. If you need both on one machine, run the second one in Docker or from its
official binary package on another port (for example 3307).
Check that it's running:
sudo mysql -e "SELECT VERSION();" # or: sudo mariadb -e "SELECT VERSION();"
Windows
- MariaDB: download the MSI installer from mariadb.org/download and keep the default port (3306). Note the root password you choose.
- MySQL: use the MySQL Installer and pick "Server only".
Open MariaDB Client or MySQL Command Line Client from the Start menu to run the SQL below.
Create the database and user
CREATE DATABASE `snaily-cad-v4` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'snailycad'@'localhost' IDENTIFIED BY 'a-strong-password';
GRANT ALL PRIVILEGES ON `snaily-cad-v4`.* TO 'snailycad'@'localhost';
FLUSH PRIVILEGES;
Then continue with the MySQL / MariaDB installation.
Remote databases
If the database runs on another server or a hosting panel, use its host and port in DB_HOST and
DB_PORT, and create the user for the CAD server's IP instead of localhost
('snailycad'@'203.0.113.10'). Never open port 3306 to the whole internet.