Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Incomplete
-
10.3.12
-
linux mint mate 19
Kernel Linux 4.15.0-44-generic x86_64
Intel® Core™ i7-3610QM CPU @ 2.30GHz × 8
Description
Welcome to the MariaDB monitor. Commands end with ; or \g. |
Your MariaDB connection id is 346 |
Server version: 10.3.12-MariaDB-1:10.3.12+maria~bionic mariadb.org binary distribution |
|
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. |
|
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. |
|
MariaDB [(none)]> create user demo1 identified by '1234'; |
Query OK, 0 rows affected (0.001 sec) |
|
MariaDB [(none)]> create role r1; |
Query OK, 0 rows affected (0.001 sec) |
|
MariaDB [(none)]> grant all on *.* to r1; |
Query OK, 0 rows affected (0.000 sec) |
|
MariaDB [(none)]> grant r1 to demo1; |
Query OK, 0 rows affected (0.001 sec) |
|
MariaDB [(none)]> show grants for r1; |
+----------------------------+ |
| Grants for r1 | |
+----------------------------+ |
| GRANT USAGE ON *.* TO 'r1' | |
+----------------------------+ |
1 row in set (0.000 sec) |
|
MariaDB [(none)]> set default role r1 for demo1; |
Query OK, 0 rows affected (0.001 sec) |
|
MariaDB [(none)]> exit
|
Bye
|
~$ mysql -u demo1 -p
|
Enter password: |
Welcome to the MariaDB monitor. Commands end with ; or \g. |
Your MariaDB connection id is 348 |
Server version: 10.3.12-MariaDB-1:10.3.12+maria~bionic mariadb.org binary distribution |
|
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. |
|
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. |
|
MariaDB [(none)]> show databases;
|
+--------------------+ |
| Database | |
+--------------------+ |
| information_schema |
|
+--------------------+ |
1 row in set (0.001 sec) |
|
MariaDB [(none)]> select current_role(); |
+----------------+ |
| current_role() |
|
+----------------+ |
| r1 |
|
+----------------+ |
1 row in set (0.000 sec) |
|
MariaDB [(none)]> show grants for demo1; |
+------------------------------------------------------------------------------------------------------+ |
| Grants for demo1@% | |
+------------------------------------------------------------------------------------------------------+ |
| GRANT r1 TO 'demo1'@'%' | |
| GRANT USAGE ON *.* TO 'demo1'@'%' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' | |
+------------------------------------------------------------------------------------------------------+ |
2 rows in set (0.000 sec) |
MariaDB [(none)]> select current_user(); |
+----------------+ |
| current_user() | |
+----------------+ |
| demo1@% |
|
+----------------+ |
1 row in set (0.000 sec) |