| 1 |
USE information_schema; |
| 2 |
#################################################################################### |
| 3 |
1 Prepare test. |
| 4 |
connection default (user=root) |
| 5 |
#################################################################################### |
| 6 |
#################################################################################### |
| 7 |
1.1 Create two user |
| 8 |
#################################################################################### |
| 9 |
DROP USER ddicttestuser1@'localhost'; |
| 10 |
DROP USER ddicttestuser2@'localhost'; |
| 11 |
CREATE USER ddicttestuser1@'localhost'; |
| 12 |
CREATE USER ddicttestuser2@'localhost'; |
| 13 |
GRANT SELECT,UPDATE,DELETE,INSERT,CREATE,CREATE TEMPORARY TABLES,CREATE VIEW,DROP on test.* to ddicttestuser1@'localhost'; |
| 14 |
GRANT SELECT,UPDATE,DELETE,INSERT,CREATE,CREATE TEMPORARY TABLES,CREATE VIEW,DROP on test.* to ddicttestuser2@'localhost'; |
| 15 |
SET PASSWORD FOR ddicttestuser1@'localhost' = PASSWORD('ddictpass'); |
| 16 |
SET PASSWORD FOR ddicttestuser2@'localhost' = PASSWORD('ddictpass'); |
| 17 |
#################################################################################### |
| 18 |
1.2 Establish connection con100 (user=ddicttestuser1 with no PROCESS privilege): |
| 19 |
connect con100,localhost,ddicttestuser1,ddictpass,information_schema; |
| 20 |
#################################################################################### |
| 21 |
#################################################################################### |
| 22 |
2 connection default(user=root with default privileges): |
| 23 |
SHOW/SELECT shows all processes/threads. |
| 24 |
#################################################################################### |
| 25 |
connection default; |
| 26 |
SHOW CREATE TABLE processlist; |
| 27 |
Table Create Table |
| 28 |
PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( |
| 29 |
`ID` bigint(4) NOT NULL, |
| 30 |
`USER` varchar(128) NOT NULL, |
| 31 |
`HOST` varchar(64) NOT NULL, |
| 32 |
`DB` varchar(64), |
| 33 |
`COMMAND` varchar(16) NOT NULL, |
| 34 |
`TIME` int(7) NOT NULL, |
| 35 |
`STATE` varchar(64), |
| 36 |
`INFO` longtext, |
| 37 |
`TIME_MS` decimal(22,3) NOT NULL, |
| 38 |
`STAGE` tinyint(2) NOT NULL, |
| 39 |
`MAX_STAGE` tinyint(2) NOT NULL, |
| 40 |
`PROGRESS` decimal(7,3) NOT NULL, |
| 41 |
`MEMORY_USED` bigint(10) NOT NULL, |
| 42 |
`MAX_MEMORY_USED` bigint(10) NOT NULL, |
| 43 |
`EXAMINED_ROWS` bigint(10) NOT NULL, |
| 44 |
`SENT_ROWS` bigint(10) NOT NULL, |
| 45 |
`QUERY_ID` bigint(10) NOT NULL, |
| 46 |
`INFO_BINARY` blob, |
| 47 |
`TID` bigint(10) NOT NULL, |
| 48 |
`TMP_SPACE_USED` bigint(10) NOT NULL |
| 49 |
) DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci |
| 50 |
SHOW processlist; |
| 51 |
Id User Host db Command Time State Info Progress |
| 52 |
ID root HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS |
| 53 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 54 |
SELECT * FROM processlist ORDER BY id; |
| 55 |
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED |
| 56 |
ID root HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID 16384 |
| 57 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 58 |
SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id; |
| 59 |
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY |
| 60 |
ID root HOST_NAME information_schema Query TIME Filling schema table SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id |
| 61 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID NULL |
| 62 |
CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist; |
| 63 |
UPDATE test.t_processlist SET user='horst' WHERE id=1 ; |
| 64 |
INSERT INTO processlist SELECT * FROM test.t_processlist; |
| 65 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 66 |
DROP TABLE test.t_processlist; |
| 67 |
CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist WITH CHECK OPTION; |
| 68 |
ERROR HY000: CHECK OPTION on non-updatable view `test`.`v_processlist` |
| 69 |
CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist; |
| 70 |
DROP VIEW test.v_processlist; |
| 71 |
UPDATE processlist SET user='any_user' WHERE id=1 ; |
| 72 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 73 |
DELETE FROM processlist WHERE id=1 ; |
| 74 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 75 |
REVOKE ALL ON processlist FROM current_user; |
| 76 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 77 |
GRANT INSERT,UPDATE ON processlist TO current_user; |
| 78 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 79 |
SHOW GRANTS; |
| 80 |
Grants for root@localhost |
| 81 |
GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION |
| 82 |
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION |
| 83 |
CREATE INDEX i_processlist ON processlist (user); |
| 84 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 85 |
DROP TABLE processlist; |
| 86 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 87 |
ALTER TABLE processlist DROP COLUMN user; |
| 88 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 89 |
ALTER TABLE processlist ADD COLUMN (my_column INT); |
| 90 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 91 |
RENAME TABLE processlist TO new_processlist; |
| 92 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 93 |
RENAME TABLE processlist TO files; |
| 94 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 95 |
CREATE TABLE new_processlist AS SELECT * FROM processlist; |
| 96 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 97 |
DROP DATABASE information_schema; |
| 98 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 99 |
RENAME DATABASE information_schema TO info_schema; |
| 100 |
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DATABASE information_schema TO info_schema' at line 1 |
| 101 |
ALTER DATABASE information_schema UPGRADE DATA DIRECTORY NAME; |
| 102 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 103 |
#################################################################################### |
| 104 |
3 Switch to connection con100 (user=ddicttestuser1 with no PROCESS privilege): |
| 105 |
connection con100; |
| 106 |
SHOW/SELECT shows only the processes (1) of the user. |
| 107 |
#################################################################################### |
| 108 |
SHOW CREATE TABLE processlist; |
| 109 |
Table Create Table |
| 110 |
PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` ( |
| 111 |
`ID` bigint(4) NOT NULL, |
| 112 |
`USER` varchar(128) NOT NULL, |
| 113 |
`HOST` varchar(64) NOT NULL, |
| 114 |
`DB` varchar(64), |
| 115 |
`COMMAND` varchar(16) NOT NULL, |
| 116 |
`TIME` int(7) NOT NULL, |
| 117 |
`STATE` varchar(64), |
| 118 |
`INFO` longtext, |
| 119 |
`TIME_MS` decimal(22,3) NOT NULL, |
| 120 |
`STAGE` tinyint(2) NOT NULL, |
| 121 |
`MAX_STAGE` tinyint(2) NOT NULL, |
| 122 |
`PROGRESS` decimal(7,3) NOT NULL, |
| 123 |
`MEMORY_USED` bigint(10) NOT NULL, |
| 124 |
`MAX_MEMORY_USED` bigint(10) NOT NULL, |
| 125 |
`EXAMINED_ROWS` bigint(10) NOT NULL, |
| 126 |
`SENT_ROWS` bigint(10) NOT NULL, |
| 127 |
`QUERY_ID` bigint(10) NOT NULL, |
| 128 |
`INFO_BINARY` blob, |
| 129 |
`TID` bigint(10) NOT NULL, |
| 130 |
`TMP_SPACE_USED` bigint(10) NOT NULL |
| 131 |
) DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci |
| 132 |
SHOW processlist; |
| 133 |
Id User Host db Command Time State Info Progress |
| 134 |
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS |
| 135 |
SELECT * FROM processlist ORDER BY id; |
| 136 |
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED |
| 137 |
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID 0 |
| 138 |
SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id; |
| 139 |
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY |
| 140 |
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id |
| 141 |
CREATE TEMPORARY TABLE test.t_processlist AS SELECT * FROM processlist; |
| 142 |
UPDATE test.t_processlist SET user='horst' WHERE id=1 ; |
| 143 |
INSERT INTO processlist SELECT * FROM test.t_processlist; |
| 144 |
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' |
| 145 |
DROP TABLE test.t_processlist; |
| 146 |
CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist WITH CHECK OPTION; |
| 147 |
ERROR HY000: CHECK OPTION on non-updatable view `test`.`v_processlist` |
| 148 |
CREATE VIEW test.v_processlist (ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY) AS SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist; |
| 149 |
DROP VIEW test.v_processlist; |
| 150 |
UPDATE processlist SET user='any_user' WHERE id=1 ; |
| 151 |
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' |
| 152 |
DELETE FROM processlist WHERE id=1 ; |
| 153 |
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' |
| 154 |
REVOKE ALL ON processlist FROM current_user; |
| 155 |
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' |
| 156 |
GRANT INSERT,UPDATE ON processlist TO current_user; |
| 157 |
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' |
| 158 |
SHOW GRANTS; |
| 159 |
Grants for ddicttestuser1@localhost |
| 160 |
GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' |
| 161 |
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, CREATE TEMPORARY TABLES, CREATE VIEW ON `test`.* TO `ddicttestuser1`@`localhost` |
| 162 |
CREATE INDEX i_processlist ON processlist (user); |
| 163 |
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' |
| 164 |
DROP TABLE processlist; |
| 165 |
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' |
| 166 |
ALTER TABLE processlist DROP COLUMN user; |
| 167 |
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' |
| 168 |
ALTER TABLE processlist ADD COLUMN (my_column INT); |
| 169 |
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' |
| 170 |
RENAME TABLE processlist TO new_processlist; |
| 171 |
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' |
| 172 |
RENAME TABLE processlist TO files; |
| 173 |
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' |
| 174 |
CREATE TABLE new_processlist AS SELECT * FROM processlist; |
| 175 |
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' |
| 176 |
DROP DATABASE information_schema; |
| 177 |
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' |
| 178 |
RENAME DATABASE information_schema TO info_schema; |
| 179 |
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DATABASE information_schema TO info_schema' at line 1 |
| 180 |
ALTER DATABASE information_schema UPGRADE DATA DIRECTORY NAME; |
| 181 |
ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' |
| 182 |
#################################################################################### |
| 183 |
4 Grant PROCESS privilege to ddicttestuser1 |
| 184 |
connection default (user=root) |
| 185 |
#################################################################################### |
| 186 |
connection default; |
| 187 |
GRANT PROCESS ON *.* TO ddicttestuser1@'localhost' IDENTIFIED BY 'ddictpass'; |
| 188 |
#################################################################################### |
| 189 |
4.1 Existing connection con100 (ddicttestuser1) |
| 190 |
The user ddicttestuser1 has the PROCESS privilege, but the connection was |
| 191 |
established before PROCESS was granted. |
| 192 |
SHOW/SELECT shows only the processes (1) of the user. |
| 193 |
#################################################################################### |
| 194 |
connection con100; |
| 195 |
SHOW GRANTS; |
| 196 |
Grants for ddicttestuser1@localhost |
| 197 |
GRANT PROCESS ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' |
| 198 |
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, CREATE TEMPORARY TABLES, CREATE VIEW ON `test`.* TO `ddicttestuser1`@`localhost` |
| 199 |
SHOW processlist; |
| 200 |
Id User Host db Command Time State Info Progress |
| 201 |
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS |
| 202 |
SELECT * FROM information_schema.processlist; |
| 203 |
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED |
| 204 |
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0 |
| 205 |
#################################################################################### |
| 206 |
4.2 New connection con101 (ddicttestuser1 with PROCESS privilege) |
| 207 |
SHOW/SELECT shows all processes/threads. |
| 208 |
#################################################################################### |
| 209 |
connect con101,localhost,ddicttestuser1,ddictpass,information_schema; |
| 210 |
SHOW GRANTS; |
| 211 |
Grants for ddicttestuser1@localhost |
| 212 |
GRANT PROCESS ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' |
| 213 |
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, CREATE TEMPORARY TABLES, CREATE VIEW ON `test`.* TO `ddicttestuser1`@`localhost` |
| 214 |
SHOW processlist; |
| 215 |
Id User Host db Command Time State Info Progress |
| 216 |
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 217 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 218 |
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS |
| 219 |
SELECT * FROM information_schema.processlist; |
| 220 |
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED |
| 221 |
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0 |
| 222 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 223 |
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 224 |
#################################################################################### |
| 225 |
5 Grant PROCESS privilege to anonymous user. |
| 226 |
connection default (user=root) |
| 227 |
#################################################################################### |
| 228 |
connection default; |
| 229 |
create user ''@'localhost'; |
| 230 |
GRANT PROCESS ON *.* TO ''@'localhost'; |
| 231 |
#################################################################################### |
| 232 |
5.1 Establish connection (anonymous1,localhost,'',,information_schema) |
| 233 |
anonymous user with PROCESS privilege |
| 234 |
SHOW/SELECT shows all processes/threads. |
| 235 |
#################################################################################### |
| 236 |
connect anonymous1,localhost,"''",,information_schema; |
| 237 |
SHOW GRANTS; |
| 238 |
Grants for @localhost |
| 239 |
GRANT PROCESS ON *.* TO ``@`localhost` |
| 240 |
SHOW processlist; |
| 241 |
Id User Host db Command Time State Info Progress |
| 242 |
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 243 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 244 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 245 |
ID HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS |
| 246 |
SELECT * FROM information_schema.processlist; |
| 247 |
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED |
| 248 |
ID HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0 |
| 249 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 250 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 251 |
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 252 |
#################################################################################### |
| 253 |
6 Revoke PROCESS privilege from ddicttestuser1 |
| 254 |
connection default (user=root) |
| 255 |
#################################################################################### |
| 256 |
connection default; |
| 257 |
REVOKE PROCESS ON *.* FROM ddicttestuser1@'localhost'; |
| 258 |
#################################################################################### |
| 259 |
6.1 New connection con102 (ddicttestuser1 has no more PROCESS privilege) |
| 260 |
connect con102,localhost,ddicttestuser1,ddictpass,information_schema; |
| 261 |
Again (compared to state before GRANT PROCESS) only the processes of |
| 262 |
ddicttestuser1 are visible. |
| 263 |
#################################################################################### |
| 264 |
SHOW GRANTS; |
| 265 |
Grants for ddicttestuser1@localhost |
| 266 |
GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' |
| 267 |
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, CREATE TEMPORARY TABLES, CREATE VIEW ON `test`.* TO `ddicttestuser1`@`localhost` |
| 268 |
SHOW processlist; |
| 269 |
Id User Host db Command Time State Info Progress |
| 270 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 271 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 272 |
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS |
| 273 |
SELECT * FROM information_schema.processlist; |
| 274 |
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED |
| 275 |
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0 |
| 276 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 277 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 278 |
#################################################################################### |
| 279 |
7 Revoke PROCESS privilege from anonymous user |
| 280 |
connection default (user=root) |
| 281 |
#################################################################################### |
| 282 |
connection default; |
| 283 |
REVOKE PROCESS ON *.* FROM ''@'localhost'; |
| 284 |
#################################################################################### |
| 285 |
7.1 New connection (anonymous2,localhost,'',,information_schema) |
| 286 |
connect anonymous2,localhost,"''",,information_schema; |
| 287 |
The anonymous user has no more the PROCESS privilege |
| 288 |
Again only the processes of the anonymous user are visible. |
| 289 |
#################################################################################### |
| 290 |
SHOW GRANTS FOR ''@'localhost'; |
| 291 |
Grants for @localhost |
| 292 |
GRANT USAGE ON *.* TO ``@`localhost` |
| 293 |
SELECT * FROM information_schema.processlist; |
| 294 |
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED |
| 295 |
ID HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0 |
| 296 |
ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 297 |
#################################################################################### |
| 298 |
8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1 |
| 299 |
connection default (user=root) |
| 300 |
#################################################################################### |
| 301 |
connection default; |
| 302 |
GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost'; |
| 303 |
#################################################################################### |
| 304 |
8.1 New connection con103 (ddicttestuser1 with SUPER privilege) |
| 305 |
connect con103,localhost,ddicttestuser1,ddictpass,information_schema; |
| 306 |
Only the processes of ddicttestuser1 user are visible. |
| 307 |
#################################################################################### |
| 308 |
SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; |
| 309 |
Grants for ddicttestuser1@localhost |
| 310 |
GRANT SUPER ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' |
| 311 |
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, CREATE TEMPORARY TABLES, CREATE VIEW ON `test`.* TO `ddicttestuser1`@`localhost` |
| 312 |
SHOW processlist; |
| 313 |
Id User Host db Command Time State Info Progress |
| 314 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 315 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 316 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 317 |
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS |
| 318 |
SELECT * FROM information_schema.processlist; |
| 319 |
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED |
| 320 |
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0 |
| 321 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 322 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 323 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 324 |
#################################################################################### |
| 325 |
9 Revoke SUPER privilege from user ddicttestuser1 |
| 326 |
connection default (user=root) |
| 327 |
#################################################################################### |
| 328 |
connection default; |
| 329 |
REVOKE SUPER ON *.* FROM 'ddicttestuser1'@'localhost'; |
| 330 |
#################################################################################### |
| 331 |
9.1 New connection con104 (ddicttestuser1 without SUPER privilege) |
| 332 |
connect con104,localhost,ddicttestuser1,ddictpass,information_schema; |
| 333 |
ddicttestuser1 has no more the SUPER privilege. |
| 334 |
Only the processes of ddicttestuser1 are visible. |
| 335 |
#################################################################################### |
| 336 |
SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; |
| 337 |
Grants for ddicttestuser1@localhost |
| 338 |
GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' |
| 339 |
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, CREATE TEMPORARY TABLES, CREATE VIEW ON `test`.* TO `ddicttestuser1`@`localhost` |
| 340 |
SHOW processlist; |
| 341 |
Id User Host db Command Time State Info Progress |
| 342 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 343 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 344 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 345 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 346 |
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS |
| 347 |
SELECT * FROM information_schema.processlist; |
| 348 |
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED |
| 349 |
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0 |
| 350 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 351 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 352 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 353 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 354 |
#################################################################################### |
| 355 |
10 Grant SUPER privilege with grant option to user ddicttestuser1. |
| 356 |
connection default (user=root) |
| 357 |
#################################################################################### |
| 358 |
connection default; |
| 359 |
GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' WITH GRANT OPTION; |
| 360 |
#################################################################################### |
| 361 |
10.1 New connection con105 (ddicttestuser1 with SUPER privilege and GRANT OPTION) |
| 362 |
connect con105,localhost,ddicttestuser1,ddictpass,information_schema; |
| 363 |
Try to grant PROCESS privilege to user ddicttestuser2 without having it. |
| 364 |
#################################################################################### |
| 365 |
SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; |
| 366 |
Grants for ddicttestuser1@localhost |
| 367 |
GRANT SUPER ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION |
| 368 |
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, CREATE TEMPORARY TABLES, CREATE VIEW ON `test`.* TO `ddicttestuser1`@`localhost` |
| 369 |
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost'; |
| 370 |
ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES) |
| 371 |
#################################################################################### |
| 372 |
10.2 Grant SUPER and PROCESS privilege with grant option to user ddicttestuser1 |
| 373 |
connection default (user=root) |
| 374 |
#################################################################################### |
| 375 |
connection default; |
| 376 |
GRANT SUPER,PROCESS ON *.* TO 'ddicttestuser1'@'localhost' WITH GRANT OPTION; |
| 377 |
#################################################################################### |
| 378 |
10.3 New connection con106 (ddicttestuser1 with SUPER,PROCESS WITH GRANT OPTION) |
| 379 |
connect con106,localhost,ddicttestuser1,ddictpass,information_schema; |
| 380 |
Grant PROCESS privilege to user ddicttestuser2 |
| 381 |
#################################################################################### |
| 382 |
SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; |
| 383 |
Grants for ddicttestuser1@localhost |
| 384 |
GRANT PROCESS, SUPER ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' WITH GRANT OPTION |
| 385 |
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, CREATE TEMPORARY TABLES, CREATE VIEW ON `test`.* TO `ddicttestuser1`@`localhost` |
| 386 |
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost'; |
| 387 |
#################################################################################### |
| 388 |
10.4 New connection con200 (ddicttestuser2 with PROCESS privilege) |
| 389 |
connect con200,localhost,ddicttestuser2,ddictpass,information_schema; |
| 390 |
ddicttestuser2 has now the PROCESS privilege and sees all connections |
| 391 |
#################################################################################### |
| 392 |
SHOW GRANTS FOR 'ddicttestuser2'@'localhost'; |
| 393 |
Grants for ddicttestuser2@localhost |
| 394 |
GRANT PROCESS ON *.* TO `ddicttestuser2`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' |
| 395 |
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, CREATE TEMPORARY TABLES, CREATE VIEW ON `test`.* TO `ddicttestuser2`@`localhost` |
| 396 |
SHOW processlist; |
| 397 |
Id User Host db Command Time State Info Progress |
| 398 |
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 399 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 400 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 401 |
ID HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 402 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 403 |
ID HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 404 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 405 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 406 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 407 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 408 |
ID ddicttestuser2 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS |
| 409 |
SELECT * FROM information_schema.processlist; |
| 410 |
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED |
| 411 |
ID ddicttestuser2 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0 |
| 412 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 413 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 414 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 415 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 416 |
ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 417 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 418 |
ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 419 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 420 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 421 |
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 422 |
#################################################################################### |
| 423 |
11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2 |
| 424 |
connection ddicttestuser1; |
| 425 |
#################################################################################### |
| 426 |
connection con106; |
| 427 |
REVOKE PROCESS ON *.* FROM 'ddicttestuser2'@'localhost'; |
| 428 |
#################################################################################### |
| 429 |
11.1 New connection con201 (ddicttestuser2) |
| 430 |
connect con201,localhost,ddicttestuser2,ddictpass,information_schema; |
| 431 |
ddicttestuser2 has no more the PROCESS privilege and can only see own connects |
| 432 |
#################################################################################### |
| 433 |
SHOW GRANTS; |
| 434 |
Grants for ddicttestuser2@localhost |
| 435 |
GRANT USAGE ON *.* TO `ddicttestuser2`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' |
| 436 |
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, CREATE TEMPORARY TABLES, CREATE VIEW ON `test`.* TO `ddicttestuser2`@`localhost` |
| 437 |
SHOW processlist; |
| 438 |
Id User Host db Command Time State Info Progress |
| 439 |
ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 440 |
ID ddicttestuser2 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS |
| 441 |
SELECT * FROM information_schema.processlist; |
| 442 |
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED |
| 443 |
ID ddicttestuser2 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0 |
| 444 |
ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 445 |
#################################################################################### |
| 446 |
11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1 |
| 447 |
connection default (user=root) |
| 448 |
#################################################################################### |
| 449 |
connection default; |
| 450 |
REVOKE SUPER,PROCESS,GRANT OPTION ON *.* FROM 'ddicttestuser1'@'localhost'; |
| 451 |
#################################################################################### |
| 452 |
11.3 New connection con107 (ddicttestuser1) |
| 453 |
connect con107,localhost,ddicttestuser1,ddictpass,information_schema; |
| 454 |
ddicttestuser1 has no more the PROCESS privilege and can only see own connects |
| 455 |
He is also unable to GRANT the PROCESS privilege to ddicttestuser2 |
| 456 |
#################################################################################### |
| 457 |
SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; |
| 458 |
Grants for ddicttestuser1@localhost |
| 459 |
GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' |
| 460 |
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, CREATE TEMPORARY TABLES, CREATE VIEW ON `test`.* TO `ddicttestuser1`@`localhost` |
| 461 |
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost'; |
| 462 |
ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password: YES) |
| 463 |
SHOW processlist; |
| 464 |
Id User Host db Command Time State Info Progress |
| 465 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 466 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 467 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 468 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 469 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 470 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 471 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 472 |
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS |
| 473 |
SELECT * FROM information_schema.processlist; |
| 474 |
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED |
| 475 |
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0 |
| 476 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 477 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 478 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 479 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 480 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 481 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 482 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 483 |
#################################################################################### |
| 484 |
12 Revoke the SELECT privilege from user ddicttestuser1 |
| 485 |
connection default (user=root) |
| 486 |
#################################################################################### |
| 487 |
connection default; |
| 488 |
REVOKE SELECT ON *.* FROM 'ddicttestuser1'@'localhost'; |
| 489 |
#################################################################################### |
| 490 |
12.1 New connection con108 (ddicttestuser1) |
| 491 |
connect con108,localhost,ddicttestuser1,ddictpass,information_schema; |
| 492 |
ddicttestuser1 has neither PROCESS nor SELECT privilege |
| 493 |
Manual says: Each MySQL user has the right to access these tables, but can see |
| 494 |
only the rows ... |
| 495 |
Therefore the missing SELECT privilege does not affect SELECTs on PROCESSLIST. |
| 496 |
#################################################################################### |
| 497 |
SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; |
| 498 |
Grants for ddicttestuser1@localhost |
| 499 |
GRANT USAGE ON *.* TO `ddicttestuser1`@`localhost` IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1' |
| 500 |
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, CREATE TEMPORARY TABLES, CREATE VIEW ON `test`.* TO `ddicttestuser1`@`localhost` |
| 501 |
SHOW processlist; |
| 502 |
Id User Host db Command Time State Info Progress |
| 503 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 504 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 505 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 506 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 507 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 508 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 509 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 510 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS |
| 511 |
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS |
| 512 |
SELECT * FROM information_schema.processlist; |
| 513 |
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED |
| 514 |
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0 |
| 515 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 516 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 517 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 518 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 519 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 520 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 521 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 522 |
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0 |
| 523 |
#################################################################################### |
| 524 |
12.2 Revoke only the SELECT privilege on the information_schema from ddicttestuser1. |
| 525 |
connection default (user=root) |
| 526 |
#################################################################################### |
| 527 |
connection default; |
| 528 |
REVOKE SELECT ON information_schema.* FROM 'ddicttestuser3'@'localhost'; |
| 529 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 530 |
#################################################################################### |
| 531 |
connection default (user=root) |
| 532 |
Cleanup: close connections, DROP USER etc. |
| 533 |
#################################################################################### |
| 534 |
connection default; |
| 535 |
disconnect con100; |
| 536 |
disconnect con101; |
| 537 |
disconnect con102; |
| 538 |
disconnect con103; |
| 539 |
disconnect con104; |
| 540 |
disconnect con105; |
| 541 |
disconnect con106; |
| 542 |
disconnect con107; |
| 543 |
disconnect con108; |
| 544 |
disconnect con200; |
| 545 |
disconnect con201; |
| 546 |
disconnect anonymous1; |
| 547 |
disconnect anonymous2; |
| 548 |
DROP USER ddicttestuser1@'localhost'; |
| 549 |
DROP USER ddicttestuser2@'localhost'; |
| 550 |
REVOKE USAGE ON *.* FROM ''@'localhost'; |
| 551 |
DROP USER ''@'localhost'; |