MariaDB
# Install MariaDB
Upgrade system
sudo dnf upgrade --refresh -y
Install MariaDB service
sudo dnf install -y mariadb-server
Check MariaDB version
mariadb --version
Enable and start MariaDB service
sudo systemctl enable --now mariadb
Config secure MariaDB
sudo mariadb-secure-installation
Login MySQL
sudo mysql -u root -p
Create database
CREATE DATABASE {db_name};
Create user MySQL
CREATE USER {username}@localhost IDENTIFIED BY {password};
Grand permission user with database
GRANT ALL PRIVILEGES ON {db_name}.* TO {username}@localhost;
Create user and add permission all databases
GRANT ALL PRIVILEGES ON *.* TO '{username}'@'localhost' IDENTIFIED BY '{password}' WITH GRANT OPTION;
Apply privileges
FLUSH PRIVILEGES;