


下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、35.蛤蟆笔记 MySQL学习一一通过SHOW获取数据库元数据MYSQL提供的SHOW语句,可以显示许多类型的元数据。列出可访问数据库mysql> show databases;+| Database|+| in formatio n_schema | mysql| performa nce_schema | sampdb| sys|+5 rows in set (0.00 sec)显示数据库的创建语句mysql> show create database sampdb;+| Database | Create Database|+| sampdb | CREATE DATABAS
2、E 'sampdb' /*!40100 DEFAULT CHARACTER SET lati n1 */ |+1 row in set (0.00 sec)列出默认数据库或给定数据库里的表mysql> show tables;+| Tables_ in _sampdb |+|absenee| grade_eve nt| log_partitio n | member| mytbl| n amelist| preside nt| score| stude nt|I t|+ 10 rows in set (0.00 sec) mysql> show tables fro
3、m mysql;+| Tables_in_mysql|+| columns_priv| db| engin e_cost| event| func| gen eral_log| gtid_executed| help_category| help_keyword| help_relati on| help_topic| innodb_in dex_stats| inno db_table_stats| n db_b inlog_in dex| plugi n| proc| procs_priv| proxies_priv| server_cost| servers| slave_master_
4、i nfo| slave_relay_lognfo| slave_worker_i nfo| slow_log| tables_priv| time_z one| time_z on e_leap_sec ond| time_z one_n ame| time_z on e_tra nsiti on| time_z on e_tra nsiti on _type | user| 31 rows in set (0.00 sec)显示表的创建语句mysql> show create table mytbl;+Table|Table|Create|+| mytbl | CREATE TABL
5、E 'mytbl' ('k' mediumint(8) unsigned NOT NULL,'j' char(10) NOT NULL,PRIMARY KEY ('k'),UNIQUE KEY 'j' ('j')ENGINES nn oDB DEFAULT CHARSET=lati n1 |+1 row in set (0.00 sec)显示表里的列或索引信息mysql> show colu mns from mytbl;+一+一一+-一+-+| Field | Type| Null | Ke
6、y | Default | Extra |+一+一一+-一+-+| k| mediumi nt(8) un sig ned | NO| PRI | NULL| j| char(10)| NO| UNI | NULL|+一+一一+-一+-+2 rows in set (0.00 sec)mysql> desc mytbl;+一+一一+-一+-+| Field | Type| Null | Key | Default | Extra |+一+一一+-一+-+| k| mediumi nt(8) un sig ned | NO| PRI | NULL| j| char(10)| NO| UNI
7、 | NULL|+一+一一+-一+-+2 rows in set (0.00 sec)mysql> explai n mytbl;+一+一一+-一+-+| Field | Type| Null | Key | Default | Extra |+一+一一+-一+-+| k| mediumi nt(8) un sig ned | NO| PRI | NULL| j| char(10)| NO| UNI | NULL|+一+一一+-一+-+2 rows in set (0.00 sec)显示索引:mysql> show index from mytbl;+| Table | Non_u
8、nique | Key_name | Seq_inndex | Column_name | Collation | Cardinality |Sub_part | Packed | Null | In dex_type | Comme nt | In dex_comme nt |+Imytbl I0 IPRIMARY I1 I kI A0INULL I NULLIIBTREEIIIImytbl I0 IjI1 I jI A0INULL I NULLIIBTREEIII+-+-+-+-+2 rows in set (0.00 sec)显示默认数据库或给定数据库里的表描述 信息mysql>
9、show table status;+-+ +| Name| Engine | Version | Row_format | Rows | Avg_row_length | Data_length |Max_data_length | Index_length | Data_free | Auto_increment | Create_time|Update_time | Check_time | Collation| Checksum | Create_options | Comment |+-+| absenee16384 |15:58:19 | NULLI| grade_event163
10、84 |15:58:19 | NULLI| log_partitio n | Inn oDB |I0 I|NULL|NULL| member|InnoDB | 0 | | NULLInnoDB I0 II NULL10 I Dynamic0 I0I lati n1_swedish_ci I10 I Dynamic0 I0I lati n1_swedish_ci I10 I Dyn amic I98304 I0 II lati n1_swedish_ci IInnoDB I10 I DynamicNULL |NULL |NULL |27302016-02-24I2730 |2016-02-24|
11、98304NULL I 2016-03-13 17:25:57NULL I partitio ned III 102 I481 I49152 |0 I0 I0 I103 I2016-02-2415:58:19 | NULL1| NULLI lat in 1_swedish_ci INULL II1| mytbl| InnoDB |10 I DynamicI0 I0 I16384 |0 I16384 I0 INULL I2016-03-1418:49:43 | NULLI| NULLI lat in 1_swedish_ci INULL II1| namelistI MEMORY I10 I F
12、ixedI0 I105 I0 |11902695 |0 I0 INULL I2016-03-1418:43:42 | NULL1I NULLI lat in 1_swedish_ci INULL II1| preside ntI InnoDB I10 I DynamicI36 I455 I16384 |0 I0 I0 INULL I2016-02-2415:58:19 | NULL1I NULLI lat in 1_swedish_ci INULL II1| scoreI InnoDB I10 I DynamicI173 I94 I16384 |0 I16384 I0 INULL I2016-
13、02-2415:58:19 | NULLII NULLI lat in 1_swedish_ci INULL II1| studentI InnoDB I10 I DynamicI31 I528 I16384 |0 I0 I0 I32 I2016-02-2415:58:19 | NULL1I NULLI lat in 1_swedish_ci INULL II1I tI InnoDB I10 I DynamicI0 I0 I16384 |0 I0 I0 INULL I2016-03-1316:20:31 | NULLI NULLI lat in 1_swedish_ci INULL II|+-+ + + + + + +10 rows in set (0.00 sec)mysql> show tables like '_ytbl:+| Tables_in_sampdb (_ytbl) |+| mytbl|+ 1 row in set (0.
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 人工智能语音识别软件开发合同
- 安全与保密措施表格(特定行业)
- 广东省深圳市福田区2024-2025学年七年级上学期期末生物学试题(含答案)
- 《中学语文文学鉴赏与实践活动教案》
- 清洁能源工程项目建设合同
- 框架协议合同
- 关于调整办公时间的内部通知流程说明
- 机械工程材料性能分析知识要点
- 关于职场礼仪的普及
- 物流配送策略对比表
- GB/T 4292-2017氟化铝
- GB/T 41-20161型六角螺母C级
- GB/T 3811-2008起重机设计规范
- CB/T 615-1995船底吸入格栅
- 11471劳动争议处理(第10章)
- 2022年河南省对口升学计算机类专业课考试真题卷
- 人工智能赋能教育教学变革的研究
- 经营性公墓建设标准
- 患教-颈动脉斑块课件
- 审计部组织架构及岗位设置
- 流行性乙型脑炎PPT课件
评论
0/150
提交评论