Welcome Demo
To add a user named 'dev' to MariaDB and grant them permissions over a database named 'example', you'll need to follow these steps:
mysql -u root -p
Replace 'root' with your MySQL username if it's different, and you'll be prompted to enter the password for the MySQL root user.
CREATE USER 'dev'@'localhost' IDENTIFIED BY 'password';
Replace 'password' with a secure password for the 'dev' user.
GRANT ALL PRIVILEGES ON example.* TO 'dev'@'localhost';
This command grants all privileges (i.e., full access) to the 'example' database for the 'dev' user. If you want to grant specific privileges, you can replace 'ALL PRIVILEGES' with the specific privileges you want to grant.
FLUSH PRIVILEGES;
exit;
That's it! You've successfully created a user named 'dev' in MariaDB and granted them permissions over the 'example' database. The 'dev' user can now connect to the 'example' database with the specified password and perform operations according to the privileges granted.