update size and add user

This commit is contained in:
Ludovic Cartier 2021-07-30 16:23:58 +02:00
parent 32056f626f
commit 73794082f8
2 changed files with 33 additions and 0 deletions

View File

@ -1,4 +1,6 @@
---
categories: databases
title: MySQL : Taille des bases de données et tables
format: markdown
...

31
mysql/user.md Normal file
View File

@ -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 `<user>`@`<host>` IDENTIFIED BY `<password>`;
```
## Affecter des droits à un utilisateur
```bash
mysql> GRANT ALL PRIVILEGES ON <database>.* TO `<user>`@`<host>` IDENTIFIED BY `<password>`;
mysql> FLUSH PRIVILEGES;
```
## Vérifier les droits d'un utilisateur
```bash
mysql> SHOW GRANTS FOR `<user>`@`<host>`;
```