This is a simple cookbook for commands which I frequintly use
-- Set the following variables
SET @username = 'your_username';
SET @password = 'your_password';
SET @network_location = '192.168.1.%';
SET @db_name = 'your_db_name';
-- Log in to MariaDB as root
mysql -u root -p
-- Create a new user with remote access
CREATE USER @username@'@network_location' IDENTIFIED BY @password;
-- Grant all privileges on the specified database to the new user
GRANT ALL PRIVILEGES ON @db_name.* TO @username@'@network_location';
-- Apply the changes
FLUSH PRIVILEGES;
-- Exit MariaDB
EXIT;