update size and add user
This commit is contained in:
parent
32056f626f
commit
73794082f8
@ -1,4 +1,6 @@
|
||||
---
|
||||
categories: databases
|
||||
title: MySQL : Taille des bases de données et tables
|
||||
format: markdown
|
||||
...
|
||||
|
||||
|
31
mysql/user.md
Normal file
31
mysql/user.md
Normal 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>`;
|
||||
```
|
Loading…
Reference in New Issue
Block a user