mariadb grant user access to database code example
Example 1: create database and grant user rights mariadb
create database [DB name];
CREATE USER '[DB_User_Name]'@'localhost' IDENTIFIED BY '[DB_Password]';
GRANT ALL PRIVILEGES ON [DB_Name].* TO '[DB_User_Name]'@'localhost';
show grants for 'demouser'@'localhost';
FLUSH PRIVILEGES;
Example 2: create user mariadb
CREATE USER 'user1'@localhost IDENTIFIED BY 'password1';