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:loesungen:l02 [2024/10/28 14:43] – angelegt vdemir | modul:m290:learningunits:lu06:loesungen:l02 [2024/11/13 16:43] (aktuell) – cbolzern | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ====== LU09.S02 - SQL- DCL: CREATE USER- Under construction | + | ====== LU09.S02 - SQL- DCL: CREATE USER ====== |
| - | ===== Case studies / Assignments | + | ===== Task 2.1 ===== |
| - | + | ||
| - | ==== Task A ==== | + | |
| **Create the User**: Create a user named // | **Create the User**: Create a user named // | ||
| CREATE USER ' | CREATE USER ' | ||
| - | ==== Task B ==== | + | ===== Task 2.2 ===== |
| - | **Grant Privileges Without Table Management**: Grant the user // | + | ** Overview of the current privileges**: Display all users. |
| - | | + | SELECT |
| + | The result set should look like: | ||
| - | ==== Task C ==== | + | {{:modul: |
| - | **Rovoke Privileges**: To be certain that nothing unintended can happen revoke the CREATE, ALTER, and DROP privileges explicitly. | + | |
| - | | + | ===== Task 2.3 ===== |
| + | **Grant Privileges Without Table Management**: | ||
| + | |||
| + | GRANT SELECT, INSERT, UPDATE, DELETE ON myDatabase.* TO ' | ||
| + | |||
| + | ===== Task 2.4 ===== | ||
| + | **Revoke Privileges**: | ||
| + | |||
| + | | ||
| - | ==== Tasc D ==== | + | ===== Tasc 2.5 ===== |
| **View the User’s Privileges**: | **View the User’s Privileges**: | ||
| SHOW GRANTS FOR ' | SHOW GRANTS FOR ' | ||
| + | | ||
| + | {{: | ||
| - | ==== Task E ==== | + | ===== Task 2.6 ===== |
| - | **Test the User’s Access**: | + | **Test the User’s Access**: |
| - | - Go to Webstorm and try to connect to the database | + | {{: |
| - | - Then display the systemdate from mysql (select is allowed) | + | |
| - | - Finally, try to create a table (it should fail, because this user has no privileges to create tables) | + | |
| - | - | + | |
| - | ==== Task F ==== | + | ===== Task 2.7 ==== |
| + | |||
| + | Finally, try to perform a CREATE TABLE or DROP TABLE operation. The attempt should result in a permission error als displayed in the image below. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | |||
| + | ===== Task 2.8 ===== | ||
| **Delete the User (optional)**: | **Delete the User (optional)**: | ||
| - | ===== Solution ===== | + | {{:modul: |
| - | [[modul: | + | |
| ===== Vocabulary ===== | ===== Vocabulary ===== | ||
| ^ English ^ German ^ | ^ English ^ German ^ | ||
| - | | explicitely | + | | .. | .. | |
| - | | assignment | Auftrag | | + | |
| - | | to revoke | widerrufen, aufheben | | + | |
| ---- | ---- | ||
| [[https:// | [[https:// | ||