grant2.result
来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· RESULT 代码 · 共 425 行 · 第 1/2 页
RESULT
425 行
revoke all privileges, grant option from 'mysqltest_1';ERROR HY000: Can't revoke all privileges for one or more of the requested usersdrop user 'mysqltest_1';select host,db,user from mysql.db where user = 'mysqltest_1' order by host,db,user;host db userinsert into mysql.tables_priv set host='%', db='test', user='mysqltest_1', table_name='t1';flush privileges;show grants for 'mysqltest_1';ERROR 42000: There is no such grant defined for user 'mysqltest_1' on host '%'drop user 'mysqltest_1';select host,db,user,table_name from mysql.tables_priv where user = 'mysqltest_1' order by host,db,user,table_name;host db user table_nameinsert into mysql.columns_priv set host='%', db='test', user='mysqltest_1', table_name='t1', column_name='c1';flush privileges;show grants for 'mysqltest_1';ERROR 42000: There is no such grant defined for user 'mysqltest_1' on host '%'drop user 'mysqltest_1';select host,db,user,table_name,column_name from mysql.columns_priv where user = 'mysqltest_1' order by host,db,user,table_name,column_name;host db user table_name column_namecreate user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';create user 'mysqltest_1', 'mysqltest_2' identified by 'Mysqltest-2', 'mysqltest_3' identified by password 'fffffffffffffffffffffffffffffffffffffffff';rename user 'mysqltest_1' to 'mysqltest_1a', 'mysqltest_2' TO 'mysqltest_2a', 'mysqltest_3' TO 'mysqltest_3a';drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';ERROR HY000: Operation DROP USER failed for 'mysqltest_1'@'%','mysqltest_2'@'%','mysqltest_3'@'%'drop user 'mysqltest_1a', 'mysqltest_2a', 'mysqltest_3a';create user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';create user 'mysqltest_1a', 'mysqltest_2', 'mysqltest_3a';ERROR HY000: Operation CREATE USER failed for 'mysqltest_2'@'%'rename user 'mysqltest_1a' to 'mysqltest_1b', 'mysqltest_2a' TO 'mysqltest_2b', 'mysqltest_3a' TO 'mysqltest_3b';ERROR HY000: Operation RENAME USER failed for 'mysqltest_2a'@'%'drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';drop user 'mysqltest_1b', 'mysqltest_2b', 'mysqltest_3b';ERROR HY000: Operation DROP USER failed for 'mysqltest_2b'@'%'create user 'mysqltest_2' identified by 'Mysqltest-2';drop user 'mysqltest_2' identified by 'Mysqltest-2';ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'Mysqltest-2'' at line 1drop user 'mysqltest_2';create user '%@b'@'b';show grants for '%@b'@'b';Grants for %@b@bGRANT USAGE ON *.* TO '%@b'@'b'grant select on mysql.* to '%@b'@'b';show grants for '%@b'@'b';Grants for %@b@bGRANT USAGE ON *.* TO '%@b'@'b'GRANT SELECT ON "mysql".* TO '%@b'@'b'rename user '%@b'@'b' to '%@a'@'a';show grants for '%@b'@'b';ERROR 42000: There is no such grant defined for user '%@b' on host 'b'show grants for '%@a'@'a';Grants for %@a@aGRANT USAGE ON *.* TO '%@a'@'a'GRANT SELECT ON "mysql".* TO '%@a'@'a'drop user '%@a'@'a';create user mysqltest_2@localhost;grant create user on *.* to mysqltest_2@localhost;select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password;ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table 'user'create user mysqltest_A@'%';rename user mysqltest_A@'%' to mysqltest_B@'%';drop user mysqltest_B@'%';drop user mysqltest_2@localhost;create user mysqltest_3@localhost;grant INSERT,DELETE,UPDATE on mysql.* to mysqltest_3@localhost;show grants;Grants for mysqltest_3@localhostGRANT USAGE ON *.* TO 'mysqltest_3'@'localhost'GRANT INSERT, UPDATE, DELETE ON `mysql`.* TO 'mysqltest_3'@'localhost'select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password;ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for table 'user'insert into mysql.user set host='%', user='mysqltest_B';Warnings:Warning 1364 Field 'ssl_cipher' doesn't have a default valueWarning 1364 Field 'x509_issuer' doesn't have a default valueWarning 1364 Field 'x509_subject' doesn't have a default valuecreate user mysqltest_A@'%';rename user mysqltest_B@'%' to mysqltest_C@'%';drop user mysqltest_C@'%';drop user mysqltest_A@'%';drop user mysqltest_3@localhost;set @@sql_mode='';create database mysqltest_1;create table mysqltest_1.t1 (i int);insert into mysqltest_1.t1 values (1),(2),(3);GRANT ALL ON mysqltest_1.t1 TO mysqltest_1@'127.0.0.0/255.0.0.0';show grants for current_user();Grants for mysqltest_1@127.0.0.0/255.0.0.0GRANT USAGE ON *.* TO 'mysqltest_1'@'127.0.0.0/255.0.0.0'GRANT ALL PRIVILEGES ON `mysqltest_1`.`t1` TO 'mysqltest_1'@'127.0.0.0/255.0.0.0'select * from t1;i123REVOKE ALL ON mysqltest_1.t1 FROM mysqltest_1@'127.0.0.0/255.0.0.0';delete from mysql.user where user like 'mysqltest\_1';flush privileges;drop table mysqltest_1.t1;grant all on mysqltest_1.* to mysqltest_1@'127.0.0.1';select current_user();current_user()mysqltest_1@127.0.0.1set password = password('changed');select host, length(password) from mysql.user where user like 'mysqltest\_1';host length(password)127.0.0.1 41revoke all on mysqltest_1.* from mysqltest_1@'127.0.0.1';delete from mysql.user where user like 'mysqltest\_1';flush privileges;grant all on mysqltest_1.* to mysqltest_1@'127.0.0.0/255.0.0.0';select current_user();current_user()mysqltest_1@127.0.0.0/255.0.0.0set password = password('changed');select host, length(password) from mysql.user where user like 'mysqltest\_1';host length(password)127.0.0.0/255.0.0.0 41revoke all on mysqltest_1.* from mysqltest_1@'127.0.0.0/255.0.0.0';delete from mysql.user where user like 'mysqltest\_1';flush privileges;drop database mysqltest_1;set password = password("changed");ERROR 42000: Access denied for user ''@'localhost' to database 'mysql'lock table mysql.user write;flush privileges;grant all on *.* to 'mysqltest_1'@'localhost';unlock tables;lock table mysql.user write;set password for 'mysqltest_1'@'localhost' = password('');revoke all on *.* from 'mysqltest_1'@'localhost';unlock tables;drop user 'mysqltest_1'@'localhost';create database TESTDB;create table t2(a int);create temporary table t1 as select * from mysql.user;delete from mysql.user where host='localhost';INSERT INTO mysql.user VALUES('%','mysqltest_1',password('password'),'N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0,0);INSERT INTO mysql.db VALUES('%','TESTDB','mysqltest_1','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','N','Y','Y','Y','Y','N');Warnings:Warning 1265 Data truncated for column 'Alter_routine_priv' at row 1FLUSH PRIVILEGES;create database TEStdb;Got one of the listed errorsdelete from mysql.user;delete from mysql.db where host='%' and user='mysqltest_1' and db='TESTDB';insert into mysql.user select * from t1;drop table t1, t2;drop database TESTDB;flush privileges;grant all privileges on test.* to `a@`@localhost;grant execute on * to `a@`@localhost;create table t2 (s1 int);insert into t2 values (1);drop function if exists f2;create function f2 () returns int begin declare v int; select s1 from t2into v; return v; end//select f2();f2()1drop function f2;drop table t2;REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;drop user `a@`@localhost;drop database if exists mysqltest_1;drop database if exists mysqltest_2;drop user mysqltest_u1@localhost;create database mysqltest_1;create database mysqltest_2;grant all on mysqltest_1.* to mysqltest_u1@localhost;use mysqltest_2;create table t1 (i int);show create table mysqltest_2.t1;ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't1'create table t1 like mysqltest_2.t1;ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't1'grant select on mysqltest_2.t1 to mysqltest_u1@localhost;show create table mysqltest_2.t1;Table Create Tablet1 CREATE TABLE `t1` ( `i` int(11) default NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1create table t1 like mysqltest_2.t1;use test;drop database mysqltest_1;drop database mysqltest_2;drop user mysqltest_u1@localhost;grant all on `mysqltest\_%`.* to mysqltest_1@localhost with grant option;grant usage on *.* to mysqltest_2@localhost;create database mysqltest_1;use mysqltest_1;create table t1 (f1 int);grant create on `mysqltest\_1`.* to mysqltest_2@localhost;grant select on mysqltest_1.t1 to mysqltest_2@localhost;create database mysqltest_3;ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'mysqltest_3'use mysqltest_1;create table t2(f1 int);select * from t1;f1drop database mysqltest_1;revoke all privileges, grant option from mysqltest_1@localhost;revoke all privileges, grant option from mysqltest_2@localhost;drop user mysqltest_1@localhost;drop user mysqltest_2@localhost;End of 5.0 tests
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?