mariadb grant all privileges to user on database code example
Example 1: mysql grant all privileges to a user
GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';
Example 2: 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 3: grant all privileges mysql
Syntax:
GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';