MySQL 中的默认数据库介绍:https://dataedo.com/kb/databases/mysql/default-databases-schemas 默认数据库 官方文档 information_schema https://dev.mysql.com/doc/refman/8.0/en/information-schema.html mysql performance_schema https://dev.mysql.com/doc/refman/8.0/en/performanc
环境说明: mysql版本:5.5.57-log 操作系统:Red Hat Enterprise Linux Server release 6.6 (Santiago) 需求:查看当前数据库下所有的表,包括视图: show tables; 查询结果: 备注:show tables显示的就是当前数据库下的所有的表和视图,如,ts开图的就都是表,v_开头的是视图. 文档创建时间:2018年3月8日10:02:14
查询所有数据库占用磁盘空间大小的SQL语句: ,),' MB') as data_size, concat(,),'MB') as index_size from information_schema.tables group by TABLE_SCHEMA order by data_length desc; 查询单个库中所有表磁盘占用大小的SQL语句: ,),' MB') as data_size, concat(,),' MB') as index_size from informatio
查询所有数据库占用磁盘空间大小的SQL语句: 复制代码 代码如下:select TABLE_SCHEMA, concat(truncate(sum(data_length)/1024/1024,2),' MB') as data_size,concat(truncate(sum(index_length)/1024/1024,2),'MB') as index_sizefrom information_schema.tablesgroup by TABLE_SCHEMAorder by data
1.下载与安装 下载地址:https://github.com/datacharmer/test_db 安装博客:https://blog.csdn.net/appleyuchi/article/details/79439387 2.ER图 注意:这里使用单下划线表示主键,使用双下划线表示即是主键也是外键.但是标准情况是使用虚线表示外键的,这里要注意一下 3.建表语句 CREATE TABLE employees ( emp_no INT NOT NULL, birth_date DATE NO
一.SQLServer命令 1.查询SQLServer中的每个数据库 SELECT * from sysdatabases 2.查询SQLServer中指定数据库的所有表名 select name from CFS.. sysobjects where xtype='u' #注意:CFS 是数据库名称 3.查询表中的字段以及字段类型 select COLUMN_name as name,data_type as type from INFORMATION_SCHEMA.COLUMNS where
grant all on *.* to root@'192.168.20.49'; grant select on *.* to root@192.168.20.49 ; -- dba 可以查询 MySQL 中所有数据库中的表. grant all on *.* to root@192.168.20.49 ; -- dba 可以管理 MySQL 中的所有数据库 以上不行就下面, 记得FLUSH刷新一下 GRANT ALL PRIVILEGES ON *.* TO 'aitang'@'192.16