home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 January / Chip_2001-01_cd1.bin / tema / mysql / mysql-3.23.28g-win.exe / DATA1.CAB / Examples / examples / tests / grant.res < prev    next >
Text File  |  2000-11-22  |  21KB  |  437 lines

  1. delete from user where user='grant_user' or user='grant_user2'
  2. delete from db where user='grant_user'
  3. delete from tables_priv
  4. delete from columns_priv
  5. lock tables mysql.user write
  6. flush privileges
  7. unlock tables
  8. drop database grant_test
  9. Error in execute: Can't drop database 'grant_test'. Database doesn't exist
  10. create database grant_test
  11. Connecting grant_user
  12. Access denied for user: '@localhost' to database 'grant_test'
  13. grant select on *.* to grant_user@localhost
  14. set password FOR grant_user2@localhost = password('test')
  15. Error in execute: Can't find any matching row in the user table
  16. set password FOR grant_user=password('test')
  17. Connecting grant_user
  18. Access denied for user: 'grant_user@localhost' (Using password: NO)
  19. set password FOR grant_user=''
  20. Connecting grant_user
  21. select * from mysql.user where user = 'grant_user'
  22. localhost    grant_user        Y    N    N    N    N    N    N    N    N    N    N    N    N    N
  23.  
  24. select * from mysql.db where user = 'grant_user'
  25. grant select on *.* to grant_user@localhost,grant_user@localhost
  26. insert into mysql.user (host,user) values ('error','grant_user')
  27. Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
  28. update mysql.user set host='error' WHERE user='grant_user'
  29. Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
  30. create table grant_test.test (a int,b int)
  31. Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
  32. grant select on *.* to grant_user2@localhost
  33. Error in execute: Access denied for user: 'grant_user@localhost' (Using password: NO)
  34. revoke select on grant_test.test from grant_user@opt_host
  35. Error in execute: There is no such grant defined for user 'grant_user' on host 'opt_host'
  36. revoke select on grant_test.* from grant_user@opt_host
  37. Error in execute: There is no such grant defined for user 'grant_user' on host 'opt_host'
  38. revoke select on *.* from grant_user
  39. Error in execute: There is no such grant defined for user 'grant_user' on host '%'
  40. grant select on grant_test.not_exists to grant_user
  41. Error in execute: Table 'grant_test.not_exists' doesn't exist
  42. grant FILE on grant_test.test to grant_user
  43. Error in execute: Illegal GRANT/REVOKE command. Please consult the manual which privileges can be used.
  44. grant select on *.* to wrong___________user_name
  45. Error in execute: The host or user argument to GRANT is too long
  46. grant select on grant_test.* to wrong___________user_name
  47. Error in execute: The host or user argument to GRANT is too long
  48. grant select on grant_test.test to grant_user with grant option
  49. Error in execute: grant command denied to user: 'grant_user@localhost' for table 'test'
  50. set password FOR ''@''=''
  51. Error in execute: You are using MySQL as an anonymous users and anonymous users are not allowed to change passwords
  52. set password FOR root@localhost = password('test')
  53. Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
  54. revoke select on *.* from grant_user@localhost
  55. grant create on *.* to grant_user@localhost
  56. Connecting grant_user
  57. create table grant_test.test (a int,b int)
  58. grant select(c) on grant_test.test to grant_user@localhost
  59. Error in execute: Unknown column 'c' in 'test'
  60. revoke select(c) on grant_test.test from grant_user@localhost
  61. Error in execute: There is no such grant defined for user 'grant_user' on host 'localhost' on table 'test'
  62. grant select on grant_test.test to wrong___________user_name
  63. Error in execute: The host or user argument to GRANT is too long
  64. INSERT INTO grant_test.test values (2,0)
  65. Error in execute: insert command denied to user: 'grant_user@localhost' for table 'test'
  66. grant ALL PRIVILEGES on *.* to grant_user@localhost
  67. REVOKE INSERT on *.* from grant_user@localhost
  68. Connecting grant_user
  69. INSERT INTO grant_test.test values (1,0)
  70. Error in execute: insert command denied to user: 'grant_user@localhost' for table 'test'
  71. grant INSERT on *.* to grant_user@localhost
  72. Connecting grant_user
  73. INSERT INTO grant_test.test values (2,0)
  74. select count(*) from grant_test.test
  75. 1
  76.  
  77. revoke SELECT on *.* from grant_user@localhost
  78. Connecting grant_user
  79. select count(*) from grant_test.test
  80. Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
  81. INSERT INTO grant_test.test values (3,0)
  82. grant SELECT on *.* to grant_user@localhost
  83. Connecting grant_user
  84. select count(*) from grant_test.test
  85. 2
  86.  
  87. revoke ALL PRIVILEGES on *.* from grant_user@localhost
  88. Connecting grant_user
  89. Access denied for user: 'grant_user@localhost' to database 'grant_test'
  90. delete from user where user='grant_user'
  91. flush privileges
  92. delete from user where user='grant_user'
  93. flush privileges
  94. grant select on grant_test.* to grant_user@localhost
  95. select * from mysql.user where user = 'grant_user'
  96. localhost    grant_user        N    N    N    N    N    N    N    N    N    N    N    N    N    N
  97.  
  98. select * from mysql.db where user = 'grant_user'
  99. localhost    grant_test    grant_user    Y    N    N    N    N    N    N    N    N    N
  100.  
  101. Connecting grant_user
  102. select count(*) from grant_test.test
  103. 2
  104.  
  105. select * from mysql.user where user = 'grant_user'
  106. Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
  107. insert into grant_test.test values (4,0)
  108. Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
  109. update grant_test.test set a=1
  110. Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
  111. delete from grant_test.test
  112. Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
  113. create table grant_test.test2 (a int)
  114. Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
  115. ALTER TABLE grant_test.test add c int
  116. Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
  117. CREATE INDEX dummy ON grant_test.test (a)
  118. Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
  119. drop table grant_test.test
  120. Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
  121. grant ALL PRIVILEGES on grant_test.* to grant_user2@localhost
  122. Error in execute: Access denied for user: 'grant_user@localhost' (Using password: NO)
  123. grant ALL PRIVILEGES on grant_test.* to grant_user@localhost WITH GRANT OPTION
  124. Connecting grant_user
  125. insert into grant_test.test values (5,0)
  126. REVOKE ALL PRIVILEGES on * from grant_user@localhost
  127. Error in execute: There is no such grant defined for user 'grant_user' on host 'localhost'
  128. REVOKE ALL PRIVILEGES on *.* from grant_user@localhost
  129. REVOKE ALL PRIVILEGES on grant_test.* from grant_user@localhost
  130. REVOKE ALL PRIVILEGES on grant_test.* from grant_user@localhost
  131. Connecting grant_user
  132. insert into grant_test.test values (6,0)
  133. Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
  134. REVOKE GRANT OPTION on grant_test.* from grant_user@localhost
  135. Connecting grant_user
  136. Access denied for user: 'grant_user@localhost' to database 'grant_test'
  137. grant ALL PRIVILEGES on grant_test.* to grant_user@localhost
  138. Connecting grant_user
  139. select * from mysql.user where user = 'grant_user'
  140. Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
  141. insert into grant_test.test values (7,0)
  142. update grant_test.test set a=3 where a=2
  143. delete from grant_test.test where a=3
  144. create table grant_test.test2 (a int not null)
  145. alter table grant_test.test2 add b int
  146. create index dummy on grant_test.test2 (a)
  147. drop table grant_test.test2
  148. show tables
  149. insert into mysql.user (host,user) values ('error','grant_user',0)
  150. Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
  151. revoke ALL PRIVILEGES on grant_test.* from grant_user@localhost
  152. select * from mysql.user where user = 'grant_user'
  153. localhost    grant_user        N    N    N    N    N    N    N    N    N    N    N    N    N    N
  154.  
  155. select * from mysql.db where user = 'grant_user'
  156. Connecting grant_user
  157. Access denied for user: 'grant_user@localhost' to database 'grant_test'
  158. grant create on grant_test.test2 to grant_user@localhost
  159. Connecting grant_user
  160. create table grant_test.test2 (a int not null)
  161. show tables
  162. test2
  163.  
  164. show columns from test
  165. Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
  166. show keys from test
  167. Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
  168. show columns from test2
  169. a    int(11)            0        
  170.  
  171. show keys from test2
  172. select * from test
  173. Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
  174. grant insert on grant_test.test to grant_user@localhost
  175. show tables
  176. test
  177. test2
  178.  
  179. insert into grant_test.test values (8,0)
  180. update grant_test.test set b=1
  181. Error in execute: update command denied to user: 'grant_user@localhost' for table 'test'
  182. grant update on grant_test.test to grant_user@localhost
  183. update grant_test.test set b=2
  184. delete from grant_test.test
  185. Error in execute: delete command denied to user: 'grant_user@localhost' for table 'test'
  186. grant delete on grant_test.test to grant_user@localhost
  187. delete from grant_test.test where a=1
  188. Error in execute: select command denied to user: 'grant_user@localhost' for column 'a' in table 'test'
  189. update grant_test.test set b=3 where b=1
  190. Error in execute: select command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
  191. update grant_test.test set b=b+1
  192. Error in execute: select command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
  193. select * from test
  194. Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
  195. grant select on grant_test.test to grant_user@localhost
  196. delete from grant_test.test where a=1
  197. update grant_test.test set b=2 where b=1
  198. update grant_test.test set b=b+1
  199. select count(*) from test
  200. 3
  201.  
  202. create table grant_test.test3 (a int)
  203. Error in execute: create command denied to user: 'grant_user@localhost' for table 'test3'
  204. alter table grant_test.test2 add c int
  205. Error in execute: alter command denied to user: 'grant_user@localhost' for table 'test2'
  206. grant alter on grant_test.test2 to grant_user@localhost
  207. alter table grant_test.test2 add c int
  208. create index dummy ON grant_test.test (a)
  209. Error in execute: index command denied to user: 'grant_user@localhost' for table 'test'
  210. grant index on grant_test.test2 to grant_user@localhost
  211. create index dummy ON grant_test.test2 (a)
  212. insert into test2 SELECT a,a from test
  213. Error in execute: insert command denied to user: 'grant_user@localhost' for table 'test2'
  214. grant insert on test2 to grant_user@localhost
  215. Error in execute: Table 'mysql.test2' doesn't exist
  216. grant insert(a) on grant_test.test2 to grant_user@localhost
  217. insert into test2 SELECT a,a from test
  218. Error in execute: insert command denied to user: 'grant_user@localhost' for column 'c' in table 'test2'
  219. grant insert(c) on grant_test.test2 to grant_user@localhost
  220. insert into test2 SELECT a,a from test
  221. select count(*) from test2,test
  222. Error in execute: select command denied to user: 'grant_user@localhost' for table 'test2'
  223. select count(*) from test,test2
  224. Error in execute: select command denied to user: 'grant_user@localhost' for table 'test2'
  225. replace into test2 SELECT a from test
  226. Error in execute: update command denied to user: 'grant_user@localhost' for table 'test2'
  227. grant update on grant_test.test2 to grant_user@localhost
  228. replace into test2 SELECT a,a from test
  229. Error in execute: delete command denied to user: 'grant_user@localhost' for table 'test2'
  230. grant DELETE on grant_test.test2 to grant_user@localhost
  231. replace into test2 SELECT a,a from test
  232. insert into test (a) SELECT a from test2
  233. Error in execute: select command denied to user: 'grant_user@localhost' for table 'test2'
  234. drop table grant_test.test2
  235. Error in execute: drop command denied to user: 'grant_user@localhost' for table 'test2'
  236. grant select on grant_test.test2 to grant_user@localhost with grant option
  237. Error in execute: select command denied to user: 'grant_user@localhost' for table 'test2'
  238. grant drop on grant_test.test2 to grant_user@localhost with grant option
  239. grant drop on grant_test.test2 to grant_user@localhost with grant option
  240. grant select on grant_test.test2 to grant_user@localhost with grant option
  241. Error in execute: select command denied to user: 'grant_user@localhost' for table 'test2'
  242. drop table grant_test.test2
  243. create database grant_test
  244. Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
  245. drop database grant_test
  246. Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
  247. flush tables
  248. Error in execute: Access denied for user: 'grant_user@localhost' (Using password: NO)
  249. flush privileges
  250. select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
  251. localhost    grant_test    grant_user    test2    grant_user@localhost    Update,Delete,Create,Drop,Grant,Index,Alter    Insert
  252. localhost    grant_test    grant_user    test    root@localhost    Select,Insert,Update,Delete    
  253.  
  254. revoke ALL PRIVILEGES on grant_test.test from grant_user@localhost
  255. revoke ALL PRIVILEGES on grant_test.test2 from grant_user@localhost
  256. revoke GRANT OPTION on grant_test.test2 from grant_user@localhost
  257. select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
  258. localhost    grant_test    grant_user    test2    root@localhost    Grant,Index,Alter    
  259.  
  260. select count(a) from test
  261. Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
  262. delete from grant_test.test where a=2
  263. Error in execute: delete command denied to user: 'grant_user@localhost' for table 'test'
  264. delete from grant_test.test where A=2
  265. Error in execute: delete command denied to user: 'grant_user@localhost' for table 'test'
  266. update test set b=5 where b>0
  267. Error in execute: update command denied to user: 'grant_user@localhost' for table 'test'
  268. grant update(b),delete on grant_test.test to grant_user@localhost
  269. revoke update(a) on grant_test.test from grant_user@localhost
  270. Error in execute: There is no such grant defined for user 'grant_user' on host 'localhost' on table 'test'
  271. delete from grant_test.test where a=2
  272. Error in execute: select command denied to user: 'grant_user@localhost' for column 'a' in table 'test'
  273. update test set b=5 where b>0
  274. Error in execute: select command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
  275. grant select(a),select(b) on grant_test.test to grant_user@localhost
  276. delete from grant_test.test where a=2
  277. delete from grant_test.test where A=2
  278. update test set b=5 where b>0
  279. update test set a=11 where b>5
  280. Error in execute: update command denied to user: 'grant_user@localhost' for column 'a' in table 'test'
  281. select a,A from test
  282. 8    8
  283. 5    5
  284. 7    7
  285.  
  286. select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
  287. localhost    grant_test    grant_user    test2    root@localhost    Grant,Index,Alter    
  288. localhost    grant_test    grant_user    test    root@localhost    Delete    Select,Update
  289.  
  290. revoke ALL PRIVILEGES on grant_test.test from grant_user@localhost
  291. select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
  292. localhost    grant_test    grant_user    test2    root@localhost    Grant,Index,Alter    
  293.  
  294. revoke GRANT OPTION on grant_test.test from grant_user@localhost
  295. Error in execute: There is no such grant defined for user 'grant_user' on host 'localhost' on table 'test'
  296. grant select(a) on grant_test.test to grant_user@localhost
  297. show columns from test
  298. a    int(11)    YES        NULL        select
  299. b    int(11)    YES        NULL        
  300.  
  301. grant insert (b), update (b) on grant_test.test to grant_user@localhost
  302. select count(a) from test
  303. 3
  304.  
  305. select count(skr.a) from test as skr
  306. 3
  307.  
  308. select count(a) from test where a > 5
  309. 2
  310.  
  311. insert into test (b) values (5)
  312. insert into test (b) values (a)
  313. update test set b=3 where a > 0
  314. select * from test
  315. Error in execute: select command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
  316. select b from test
  317. Error in execute: select command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
  318. select a from test where b > 0
  319. Error in execute: select command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
  320. insert into test (a) values (10)
  321. Error in execute: insert command denied to user: 'grant_user@localhost' for column 'a' in table 'test'
  322. insert into test (b) values (b)
  323. Error in execute: select command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
  324. insert into test (a,b) values (1,5)
  325. Error in execute: insert command denied to user: 'grant_user@localhost' for column 'a' in table 'test'
  326. insert into test (b) values (1),(b)
  327. Error in execute: select command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
  328. update test set b=3 where b > 0
  329. Error in execute: select command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
  330. select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
  331. localhost    grant_test    grant_user    test2    root@localhost    Grant,Index,Alter    
  332. localhost    grant_test    grant_user    test    root@localhost        Select,Insert,Update
  333.  
  334. select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv
  335. localhost    grant_test    grant_user    test    b    Insert,Update
  336. localhost    grant_test    grant_user    test    a    Select
  337.  
  338. revoke select(a), update (b) on grant_test.test from grant_user@localhost
  339. select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
  340. localhost    grant_test    grant_user    test2    root@localhost    Grant,Index,Alter    
  341. localhost    grant_test    grant_user    test    root@localhost        Insert
  342.  
  343. select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv
  344. localhost    grant_test    grant_user    test    b    Insert
  345.  
  346. select count(a) from test
  347. Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
  348. update test set b=4
  349. Error in execute: update command denied to user: 'grant_user@localhost' for table 'test'
  350. grant select(a,b), update (a,b) on grant_test.test to grant_user@localhost
  351. select count(a),count(b) from test where a+b > 0
  352. 3    3
  353.  
  354. insert into test (b) values (9)
  355. update test set b=6 where b > 0
  356. flush privileges
  357. select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
  358. localhost    grant_test    grant_user    test2    root@localhost    Grant,Index,Alter    
  359. localhost    grant_test    grant_user    test    root@localhost        Select,Insert,Update
  360.  
  361. select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv
  362. localhost    grant_test    grant_user    test    b    Select,Insert,Update
  363. localhost    grant_test    grant_user    test    a    Select,Update
  364.  
  365. insert into test (a,b) values (12,12)
  366. Error in execute: insert command denied to user: 'grant_user@localhost' for column 'a' in table 'test'
  367. grant insert on grant_test.* to grant_user@localhost
  368. Connecting grant_user
  369. insert into test (a,b) values (13,13)
  370. revoke select(b) on grant_test.test from grant_user@localhost
  371. select count(a) from test where a+b > 0
  372. Error in execute: select command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
  373. update test set b=5 where a=2
  374. grant select on grant_test.test to grant_user@localhost
  375. Connecting grant_user
  376. select count(a) from test where a+b > 0
  377. 4
  378.  
  379. revoke select(b) on grant_test.test from grant_user@localhost
  380. select count(a) from test where a+b > 0
  381. 4
  382.  
  383. revoke select on grant_test.test from grant_user@localhost
  384. Connecting grant_user
  385. select count(a) from test where a+b > 0
  386. Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
  387. grant select(a) on grant_test.test to grant_user@localhost
  388. select count(a) from test where a+b > 0
  389. Error in execute: select command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
  390. grant select on *.* to grant_user@localhost
  391. Connecting grant_user
  392. select count(a) from test where a+b > 0
  393. 4
  394.  
  395. revoke select on *.* from grant_user@localhost
  396. grant select(b) on grant_test.test to grant_user@localhost
  397. Connecting grant_user
  398. select count(a) from test where a+b > 0
  399. 4
  400.  
  401. select * from mysql.db where user = 'grant_user'
  402. localhost    grant_test    grant_user    N    Y    N    N    N    N    N    N    N    N
  403.  
  404. select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv where user = 'grant_user'
  405. localhost    grant_test    grant_user    test2    root@localhost    Grant,Index,Alter    
  406. localhost    grant_test    grant_user    test    root@localhost        Select,Insert,Update
  407.  
  408. select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv where user = 'grant_user'
  409. localhost    grant_test    grant_user    test    b    Select,Insert,Update
  410. localhost    grant_test    grant_user    test    a    Select,Update
  411.  
  412. revoke ALL PRIVILEGES on grant_test.test from grant_user@localhost
  413. select count(a) from test
  414. Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
  415. select * from mysql.user
  416. Error in execute: select command denied to user: 'grant_user@localhost' for table 'user'
  417. select * from mysql.db where user = 'grant_user'
  418. localhost    grant_test    grant_user    N    Y    N    N    N    N    N    N    N    N
  419.  
  420. select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv where user = 'grant_user'
  421. localhost    grant_test    grant_user    test2    root@localhost    Grant,Index,Alter    
  422.  
  423. select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv where user = 'grant_user'
  424. delete from user where user='grant_user'
  425. flush privileges
  426. grant ALL PRIVILEGES on grant_test.test to grant_user@localhost identified by 'dummy',  grant_user@127.0.0.1 identified by 'dummy2'
  427. Connecting grant_user
  428. grant SELECT on grant_test.* to grant_user@localhost identified by ''
  429. Connecting grant_user
  430. drop database grant_test
  431. delete from user where user='grant_user'
  432. delete from db where user='grant_user'
  433. delete from tables_priv
  434. delete from columns_priv
  435. flush privileges
  436. end of test
  437.