Rimuovere Utenti Dal SQL Server: differenze tra le versioni
Nessun oggetto della modifica |
Nessun oggetto della modifica |
||
| Riga 10: | Riga 10: | ||
<div id="atscreen"> | <div id="atscreen"> | ||
MariaDB [(none)]> SHOW GRANTS FOR 'iu6crh'@'%'; | MariaDB [(none)]> SHOW GRANTS FOR 'iu6crh'@'%';<br> | ||
<br> | |||
+-------------------------------------------------------------------------------------------------------+ | +-------------------------------------------------------------------------------------------------------+<br> | ||
| Grants for iu6crh@% | | | Grants for iu6crh@% |<br> | ||
+-------------------------------------------------------------------------------------------------------+ | +-------------------------------------------------------------------------------------------------------+<br> | ||
| GRANT USAGE ON *.* TO 'iu6crh'@'%' IDENTIFIED BY PASSWORD '*6DA413D8ACD33A112877D31A8BD9DDFB36411631' | | | GRANT USAGE ON *.* TO 'iu6crh'@'%' IDENTIFIED BY PASSWORD '*6DA413D8ACD33A112877D31A8BD9DDFB36411631' |<br> | ||
| GRANT ALL PRIVILEGES ON `hamlog`.* TO 'iu6crh'@'%' | | | GRANT ALL PRIVILEGES ON `hamlog`.* TO 'iu6crh'@'%' |<br> | ||
+-------------------------------------------------------------------------------------------------------+ | +-------------------------------------------------------------------------------------------------------+<br> | ||
2 rows in set (0.00 sec) | 2 rows in set (0.00 sec)<br> | ||
MariaDB [(none)]> REVOKE ALL privileges ON hamlog.* FROM 'iu6crh'@'%';<br> | |||
Query OK, 0 rows affected (0.00 sec)<br> | |||
<br> | |||
MariaDB [(none)]> SHOW GRANTS FOR 'iu6crh'@'%';<br> | |||
+-------------------------------------------------------------------------------------------------------+<br> | |||
| Grants for iu6crh@% |<br> | |||
+-------------------------------------------------------------------------------------------------------+<br> | |||
| GRANT USAGE ON *.* TO 'iu6crh'@'%' IDENTIFIED BY PASSWORD '*6DA413D8ACD33A112877D31A8BD9DDFB36411631' |<br> | |||
+-------------------------------------------------------------------------------------------------------+<br> | |||
1 row in set (0.00 sec)<br> | |||
<br> | |||
MariaDB [(none)]> | MariaDB [(none)]> | ||
</div> | </div> | ||
| Riga 37: | Riga 37: | ||
<div id="atscreen"> | <div id="atscreen"> | ||
MariaDB [(none)]> SELECT User, Host, Password, password_expired FROM mysql.user; | MariaDB [(none)]> SELECT User, Host, Password, password_expired FROM mysql.user;<br> | ||
+--------+-----------+-------------------------------------------+------------------+ | +--------+-----------+-------------------------------------------+------------------+<br> | ||
| User | Host | Password | password_expired | | | User | Host | Password | password_expired |<br> | ||
+--------+-----------+-------------------------------------------+------------------+ | +--------+-----------+-------------------------------------------+------------------+<br> | ||
| root | localhost | | N | | | root | localhost | | N |<br> | ||
| iu6crh | % | *6DA413D8ACD33A112877D31A8BD9DDFB36411631 | N | | | iu6crh | % | *6DA413D8ACD33A112877D31A8BD9DDFB36411631 | N |<br> | ||
+--------+-----------+-------------------------------------------+------------------+ | +--------+-----------+-------------------------------------------+------------------+<br> | ||
2 rows in set (0.00 sec) | 2 rows in set (0.00 sec)<br> | ||
<br> | |||
MariaDB [(none)]> drop user iu6crh; | MariaDB [(none)]> drop user iu6crh;<br> | ||
Query OK, 0 rows affected (0.00 sec) | Query OK, 0 rows affected (0.00 sec)<br> | ||
<br> | |||
MariaDB [(none)]> SELECT User, Host, Password, password_expired FROM mysql.user; | MariaDB [(none)]> SELECT User, Host, Password, password_expired FROM mysql.user;<br> | ||
+------+-----------+----------+------------------+ | +------+-----------+----------+------------------+<br> | ||
| User | Host | Password | password_expired | | | User | Host | Password | password_expired |<br> | ||
+------+-----------+----------+------------------+ | +------+-----------+----------+------------------+<br> | ||
| root | localhost | | N | | | root | localhost | | N |<br> | ||
+------+-----------+----------+------------------+ | +------+-----------+----------+------------------+<br> | ||
1 row in set (0.00 sec) | 1 row in set (0.00 sec)<br> | ||
<br> | |||
MariaDB [(none)]> | MariaDB [(none)]> | ||
</div> | </div> | ||
Versione delle 21:53, 13 mag 2021
il comando DROP USER rimuove un utente dal SQL Server ma e' bene precisare che da solo esso non e' sufficiente in quanto il rimuovere l'utente non si concretizza con la contemporanea rimozione dei permessi ad esso correlati.
Si procede per tanto come segue:
Rimozione dei privilegi:
MariaDB [(none)]> SHOW GRANTS FOR 'iu6crh'@'%';
+-------------------------------------------------------------------------------------------------------+
| Grants for iu6crh@% |
+-------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'iu6crh'@'%' IDENTIFIED BY PASSWORD '*6DA413D8ACD33A112877D31A8BD9DDFB36411631' |
| GRANT ALL PRIVILEGES ON `hamlog`.* TO 'iu6crh'@'%' |
+-------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
MariaDB [(none)]> REVOKE ALL privileges ON hamlog.* FROM 'iu6crh'@'%';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> SHOW GRANTS FOR 'iu6crh'@'%';
+-------------------------------------------------------------------------------------------------------+
| Grants for iu6crh@% |
+-------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'iu6crh'@'%' IDENTIFIED BY PASSWORD '*6DA413D8ACD33A112877D31A8BD9DDFB36411631' |
+-------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
MariaDB [(none)]>
Rimozione dell'utente:
MariaDB [(none)]> SELECT User, Host, Password, password_expired FROM mysql.user;
+--------+-----------+-------------------------------------------+------------------+
| User | Host | Password | password_expired |
+--------+-----------+-------------------------------------------+------------------+
| root | localhost | | N |
| iu6crh | % | *6DA413D8ACD33A112877D31A8BD9DDFB36411631 | N |
+--------+-----------+-------------------------------------------+------------------+
2 rows in set (0.00 sec)
MariaDB [(none)]> drop user iu6crh;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> SELECT User, Host, Password, password_expired FROM mysql.user;
+------+-----------+----------+------------------+
| User | Host | Password | password_expired |
+------+-----------+----------+------------------+
| root | localhost | | N |
+------+-----------+----------+------------------+
1 row in set (0.00 sec)
MariaDB [(none)]>