First, login to the server as root.
mysql -u root
If your MySQL / MariaDB installation is not set up to allow you in without a password, add the -p flag.
mysql -u root -p
This will prompt you for your root password. Once you’re in, run this after replacing the variables with your preferred values:
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
If you want to allow remote connections, use this instead. Keep in mind that this is less secure.
CREATE USER 'admin'@'%' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;