sudo apt update sudo apt upgrade
sudo apt install mariadb-server
sudo mysql_secure_installation
sudo mysql -u root -p
CREATE DATABASE retrostats;
CREATE USER 'retrostats'@'localhost' IDENTIFIED BY 'retrostats'; CREATE USER 'retrostats'@'%' IDENTIFIED BY 'retrostats';
GRANT ALL PRIVILEGES ON retrostats.* TO 'retrostats'@'localhost'; GRANT ALL PRIVILEGES ON retrostats.* TO 'retrostats'@'%';
FLUSH PRIVILEGES;
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
sudo service mysql restart
CREATE TABLE sessions (id INT AUTO_INCREMENT, initDate DATE, duration INT, score INT, gameId INT, gameName VARCHAR(255), gameEmulator VARCHAR(255), gamePath VARCHAR(255), userId INT, state VARCHAR(255), PRIMARY KEY(id));