MariaDB Database and User creation

Given below commands to create the both local user & remote user.

Create a new database

MariaDB> create database DATABASE_NAME;

Creating new user (for local access) and grant privileges to user for the new database

MariaDB> grant all privileges on DATABASE_NAME.* TO 'USER_NAME'@'localhost' identified by 'PASSWORD';

Creating a new user (for remote access) and grant privileges to the user for the new database:

MariaDB> grant all privileges on DATABASE_NAME.* TO 'USER_NAME'@'%' identified by 'PASSWORD';

After modifying the MariaDB grant tables, need to execute the following command to apply the changes

MariaDB> flush privileges;