Dexter Evil Clone.

Alchemiclabs.ca


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:

  1. Connect to MariaDB: First, you need to connect to your MariaDB server using the MySQL command-line client or any other MySQL client tool.
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.

  1. Create a new User: Once connected, you can create a new user named 'dev':
CREATE USER 'dev'@'localhost' IDENTIFIED BY 'password';

Replace 'password' with a secure password for the 'dev' user.

  1. Grant Permissions: Next, grant the necessary permissions to the 'dev' user for the 'example' database:
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.

  1. Flush Privileges: After granting the privileges, you need to flush the privileges to ensure that they take effect immediately:
FLUSH PRIVILEGES;
  1. Exit MariaDB: Once you've completed the above steps, you can exit the MariaDB prompt:
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.