Utilisation de Mariadb
Création d’une base de données
# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 13
Server version: 10.5.9-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
Création d’un utilisateur
MariaDB [(none)]> CREATE USER 'my_user'@'localhost' IDENTIFIED BY 'Secure_Password';
Query OK, 0 rows affected (0.002 sec)
Création d’une base de données
MariaDB [(none)]> CREATE DATABASE IF NOT EXISTS my_db ;
Query OK, 1 row affected (0.000 sec)
Attribution des droits de l’utilisateur sur la base de données créée
MariaDB [(none)]> GRANT ALL PRIVILEGES ON my_db . * TO 'my_user'@'localhost';
Query OK, 0 rows affected (0.002 sec)
Vérification
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| db01 |
| information_schema |
| mysql |
| performance_schema |
+--------------------+
4 rows in set (0.001 sec)