From 73794082f8a351ae43d01901a3c759a949c628b1 Mon Sep 17 00:00:00 2001 From: Ludovic Cartier Date: Fri, 30 Jul 2021 16:23:58 +0200 Subject: [PATCH] update size and add user --- mysql/size.md | 2 ++ mysql/user.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 mysql/user.md diff --git a/mysql/size.md b/mysql/size.md index ebeaad8..5a8805a 100644 --- a/mysql/size.md +++ b/mysql/size.md @@ -1,4 +1,6 @@ --- +categories: databases +title: MySQL : Taille des bases de données et tables format: markdown ... diff --git a/mysql/user.md b/mysql/user.md new file mode 100644 index 0000000..a53454b --- /dev/null +++ b/mysql/user.md @@ -0,0 +1,31 @@ +--- +categories: databases +title: MySQL : Gestion des utilisateurs +format: markdown +... + + +## Obtenir la liste des utilisateurs + +```bash +mysql> SELECT User, Host from mysql.user; +``` + +## Créer un nouvel utilisateur + +```bash +mysql> CREATE USER ``@`` IDENTIFIED BY ``; +``` + +## Affecter des droits à un utilisateur + +```bash +mysql> GRANT ALL PRIVILEGES ON .* TO ``@`` IDENTIFIED BY ``; +mysql> FLUSH PRIVILEGES; +``` + +## Vérifier les droits d'un utilisateur + +```bash +mysql> SHOW GRANTS FOR ``@``; +```