Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
modul:m290:learningunits:lu06:theorie:01 [2024/10/17 12:05] – [3. Viewing User Privileges] vdemir | modul:m290:learningunits:lu06:theorie:01 [2024/11/16 09:00] (aktuell) – kdemirci | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ====== LU09a - USER and Privilege | + | ====== LU09a - USER and PRIVILEGE |
===== Learning Objectives ===== | ===== Learning Objectives ===== | ||
Zeile 7: | Zeile 7: | ||
- Revoke privileges from user | - Revoke privileges from user | ||
- Deleting obsolete user | - Deleting obsolete user | ||
- | |||
| | ||
- | ===== Introcuction | + | ===== Introduction |
In a warehouse such as Globus, Manor or Lafayette there are different user categories with different authorizations and privileges. According to the required responsibilties the general manager e.g. has full privileges, while the apprentice has much fewer. And as we know, a database is basicly a warehouse, not for goods, but for data. | In a warehouse such as Globus, Manor or Lafayette there are different user categories with different authorizations and privileges. According to the required responsibilties the general manager e.g. has full privileges, while the apprentice has much fewer. And as we know, a database is basicly a warehouse, not for goods, but for data. | ||
Zeile 24: | Zeile 23: | ||
To create a new user in MySQL, you use the CREATE USER statement: | To create a new user in MySQL, you use the CREATE USER statement: | ||
- | CREATE USER ' | + | CREATE USER ' |
| | ||
- | This creates a user username that can only connect from localhost (the MySQL server machine). | + | This creates a user username that can only connect from localhost (the MySQL server machine). |
+ | |||
+ | ** Note ** | ||
+ | |||
+ | MySQL supports several types of password authentication mechanisms. These include: | ||
+ | |||
+ | - **mysql_native_password**: | ||
+ | - **caching_sha2_password**: | ||
+ | - **sha256_password**: | ||
+ | - **auth_socket**: | ||
+ | - **auth_pam**: | ||
+ | - **authentication_ldap_sasl**: | ||
+ | - **authentication_ldap_simple**: | ||
==== 2. Granting Privileges == | ==== 2. Granting Privileges == | ||
Zeile 47: | Zeile 58: | ||
REVOKE INSERT ON database_name.* FROM ' | REVOKE INSERT ON database_name.* FROM ' | ||
| | ||
- | ==== Dropping a User ==== | + | ==== 5. Dropping a User ==== |
If a user is no longer needed, you can remove the account using the DROP USER statement: | If a user is no longer needed, you can remove the account using the DROP USER statement: | ||
Zeile 54: | Zeile 65: | ||
This removes both the user and their associated privileges. | This removes both the user and their associated privileges. | ||
+ | ==== 6. Activating Change of Privileges After Altering Them ==== | ||
+ | To activate changes to privileges in MySQL after modifying them, you can use the following command: | ||
+ | |||
+ | FLUSH PRIVILEGES; | ||
+ | |||
+ | This command forces MySQL to reload the privilege tables, applying any recent changes made to user privileges. Normally, after using GRANT, REVOKE, or ALTER USER, MySQL applies changes automatically, | ||
+ | |||
+ | <color # | ||
+ | |||
+ | | ||
+ | |||
+ | ===== Video-Tutorials ==== | ||
+ | ^How to Create a New User in MySQL |{{: | ||
+ | ^Create User, Grant ReadWrite Privileges and Test Privileges Granted in MySQL |{{: | ||
==== Vocabulary ==== | ==== Vocabulary ==== |