MySQL中有四个系统数据库: (nformation_schema,mysql,performance_schema,sys) (5.6版本为information_schema,mysql,performance_schema,test) information_schema:提供访问数据库元的 ...
分类:
数据库 时间:
2020-02-01 17:52:36
阅读次数:
130
mysql的基本用法: 查库:select schema_name from information_schema.schemata 等同于 show databases 查表:select table_name from information_schema.tables where table_ ...
分类:
数据库 时间:
2020-01-31 15:55:44
阅读次数:
116
SELECT CONCAT( 'ALTER TABLE ' ,TABLE_NAME ,' ENGINE=INNODB, ROW_FORMAT=DYNAMIC; ') as `sql-commands-for-convert-engine` FROM information_schema.TABLES ...
分类:
数据库 时间:
2020-01-31 10:51:41
阅读次数:
99
1、查询是否锁表 show OPEN TABLES where In_use > 0; 查询到相对应的进程 然后 kill id 2、查询进程 show processlist 补充: 查看正在锁的事务 SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS; 查 ...
分类:
数据库 时间:
2020-01-30 22:43:02
阅读次数:
111
SELECT CONCAT( 'ALTER TABLE ', table_name, ' RENAME TO db_', substring(table_name, 4), ';' ) FROM information_schema. TABLES WHERE table_name LIKE 'ct ...
分类:
其他好文 时间:
2020-01-28 17:23:51
阅读次数:
72
Select 'SET FOREIGN_KEY_CHECKS = 0;'unionSelect CONCAT( 'drop table ', table_name, ';' )FROM information_schema.tablesWhere table_name LIKE 'as_baiqis ...
分类:
数据库 时间:
2020-01-27 17:26:47
阅读次数:
323
可以开始第一关: 1-10关都是GET型 MYSQL基本用法: 查库:select schema_name from information_schema.schemata; 查表:select table_name from information_schema.tables where tabl ...
分类:
数据库 时间:
2020-01-27 13:57:42
阅读次数:
87
一、简单描述表结构,字段类型 desc tabl_name; 显示表结构,字段类型,主键,是否为空等属性,但不显示外键。 例如:desc table_name 二、查询表中列的注释信息 select * from information_schema.columnswhere table_schem ...
分类:
数据库 时间:
2020-01-26 17:30:13
阅读次数:
91
查库: select schema_name from information_schema.schemata;查表: select table_name from information_schema.tables where table_schema='security';查列: select ...
分类:
数据库 时间:
2020-01-22 23:57:45
阅读次数:
178
原文:获取数据表列相关数据 虽然本人在开发数据库时,不太使用视图,但是还是知道 如何获取视图中使用的所有表列: SELECT * FROM INFORMATION_SCHEMA.VIEW_COLUMN_USAGE View Code 如何获取包含视图所有表: SELECT * FROM INFORM... ...
分类:
其他好文 时间:
2020-01-17 10:17:42
阅读次数:
71