This is a memo when MariaDB is installed to use EC2 of Linux2 as a DB server on AWS. (Overwhelmingly for myself)
First of all
sudo yum update -y
installation of mariaDB
sudo yum -y install mariadb-server
mariaDB start
sudo systemctl start mariadb
Set the password for the DB root account
mysqladmin -u root password
Log in to the DB with the password you set with the root account
mysql -u root -p
Create DB with {database name}
CREATE DATABASE {Database name} DEFAULT CHARACTER SET utf8 COLLATE uft8_general_ci;
The user who has given full operation authority to the created {database name} DB Created with {username} and {password}
grant all on {Database name}.* to {username}@"%" identified by '{password}';
From the next time onward, set mariaDB to start automatically when the server starts
sudo systemctl enable mariadb