This commit is contained in:
2021-05-06 11:33:48 +08:00
commit 89d591c088
99 changed files with 8480 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
node_modules

4
docs/.vuepress/config.js Normal file
View File

@@ -0,0 +1,4 @@
module.exports = {
title: '测试',
description: '测试'
}

20
docs/.vuepress/dist/404.html vendored Normal file
View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>测试</title>
<meta name="generator" content="VuePress 1.8.2">
<meta name="description" content="测试">
<link rel="preload" href="/assets/css/0.styles.e4d8b86b.css" as="style"><link rel="preload" href="/assets/js/app.44f0a4c8.js" as="script"><link rel="preload" href="/assets/js/9.4839daec.js" as="script"><link rel="prefetch" href="/assets/js/10.c524dfdd.js"><link rel="prefetch" href="/assets/js/2.ed656cef.js"><link rel="prefetch" href="/assets/js/3.4b56ecab.js"><link rel="prefetch" href="/assets/js/4.cf9ea75d.js"><link rel="prefetch" href="/assets/js/5.d2773c15.js"><link rel="prefetch" href="/assets/js/6.a7a6a0d9.js"><link rel="prefetch" href="/assets/js/7.44486ff1.js"><link rel="prefetch" href="/assets/js/8.4b83fec6.js">
<link rel="stylesheet" href="/assets/css/0.styles.e4d8b86b.css">
</head>
<body>
<div id="app" data-server-rendered="true"><div class="theme-container"><div class="theme-default-content"><h1>404</h1> <blockquote>Looks like we've got some broken links.</blockquote> <a href="/" class="router-link-active">
Take me home.
</a></div></div><div class="global-ui"></div></div>
<script src="/assets/js/app.44f0a4c8.js" defer></script><script src="/assets/js/9.4839daec.js" defer></script>
</body>
</html>

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="12" height="13"><g stroke-width="2" stroke="#aaa" fill="none"><path d="M11.29 11.71l-4-4"/><circle cx="5" cy="5" r="4"/></g></svg>

After

Width:  |  Height:  |  Size: 216 B

View File

@@ -0,0 +1 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{402:function(t,a,s){"use strict";s.r(a);var r=s(45),e=Object(r.a)({},(function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"测试课程教案"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#测试课程教案"}},[t._v("#")]),t._v(" 测试课程教案")]),t._v(" "),s("h2",{attrs:{id:"mysql"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#mysql"}},[t._v("#")]),t._v(" mysql")]),t._v(" "),s("h2",{attrs:{id:"http"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#http"}},[t._v("#")]),t._v(" http")]),t._v(" "),s("h2",{attrs:{id:"flask"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#flask"}},[t._v("#")]),t._v(" flask")]),t._v(" "),s("h2",{attrs:{id:"linux"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#linux"}},[t._v("#")]),t._v(" linux")])])}),[],!1,null,null,null);a.default=e.exports}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{327:function(t,e,n){},394:function(t,e,n){"use strict";n(327)},405:function(t,e,n){"use strict";n.r(e);var i={functional:!0,props:{type:{type:String,default:"tip"},text:String,vertical:{type:String,default:"top"}},render:function(t,e){var n=e.props,i=e.slots;return t("span",{class:["badge",n.type],style:{verticalAlign:n.vertical}},n.text||i().default)}},r=(n(394),n(45)),p=Object(r.a)(i,void 0,void 0,!1,null,"15b7b770",null);e.default=p.exports}}]);

View File

@@ -0,0 +1 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{328:function(t,e,a){},395:function(t,e,a){"use strict";a(328)},399:function(t,e,a){"use strict";a.r(e);var n={name:"CodeBlock",props:{title:{type:String,required:!0},active:{type:Boolean,default:!1}},mounted:function(){this.$parent&&this.$parent.loadTabs&&this.$parent.loadTabs()}},i=(a(395),a(45)),s=Object(i.a)(n,(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"theme-code-block",class:{"theme-code-block__active":this.active}},[this._t("default")],2)}),[],!1,null,"759a7d02",null);e.default=s.exports}}]);

View File

@@ -0,0 +1 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{329:function(e,t,a){},396:function(e,t,a){"use strict";a(329)},400:function(e,t,a){"use strict";a.r(t);a(66),a(27),a(94),a(95);var o={name:"CodeGroup",data:function(){return{codeTabs:[],activeCodeTabIndex:-1}},watch:{activeCodeTabIndex:function(e){this.activateCodeTab(e)}},mounted:function(){this.loadTabs()},methods:{changeCodeTab:function(e){this.activeCodeTabIndex=e},loadTabs:function(){var e=this;this.codeTabs=(this.$slots.default||[]).filter((function(e){return Boolean(e.componentOptions)})).map((function(t,a){return""===t.componentOptions.propsData.active&&(e.activeCodeTabIndex=a),{title:t.componentOptions.propsData.title,elm:t.elm}})),-1===this.activeCodeTabIndex&&this.codeTabs.length>0&&(this.activeCodeTabIndex=0),this.activateCodeTab(0)},activateCodeTab:function(e){this.codeTabs.forEach((function(e){e.elm&&e.elm.classList.remove("theme-code-block__active")})),this.codeTabs[e].elm&&this.codeTabs[e].elm.classList.add("theme-code-block__active")}}},n=(a(396),a(45)),c=Object(n.a)(o,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ClientOnly",[a("div",{staticClass:"theme-code-group"},[a("div",{staticClass:"theme-code-group__nav"},[a("ul",{staticClass:"theme-code-group__ul"},e._l(e.codeTabs,(function(t,o){return a("li",{key:t.title,staticClass:"theme-code-group__li"},[a("button",{staticClass:"theme-code-group__nav-tab",class:{"theme-code-group__nav-tab-active":o===e.activeCodeTabIndex},on:{click:function(t){return e.changeCodeTab(o)}}},[e._v("\n "+e._s(t.title)+"\n ")])])})),0)]),e._v(" "),e._t("default"),e._v(" "),e.codeTabs.length<1?a("pre",{staticClass:"pre-blank"},[e._v("// Make sure to add code blocks to your code group")]):e._e()],2)])}),[],!1,null,"deefee04",null);t.default=c.exports}}]);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{398:function(t,e,s){"use strict";s.r(e);var n=["There's nothing here.","How did we get here?","That's a Four-Oh-Four.","Looks like we've got some broken links."],o={methods:{getMsg:function(){return n[Math.floor(Math.random()*n.length)]}}},i=s(45),h=Object(i.a)(o,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"theme-container"},[e("div",{staticClass:"theme-default-content"},[e("h1",[this._v("404")]),this._v(" "),e("blockquote",[this._v(this._s(this.getMsg()))]),this._v(" "),e("RouterLink",{attrs:{to:"/"}},[this._v("\n Take me home.\n ")])],1)])}),[],!1,null,null,null);e.default=h.exports}}]);

File diff suppressed because one or more lines are too long

18
docs/.vuepress/dist/index.html vendored Normal file
View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>测试课程教案 | 测试</title>
<meta name="generator" content="VuePress 1.8.2">
<meta name="description" content="测试">
<link rel="preload" href="/assets/css/0.styles.e4d8b86b.css" as="style"><link rel="preload" href="/assets/js/app.44f0a4c8.js" as="script"><link rel="preload" href="/assets/js/2.ed656cef.js" as="script"><link rel="preload" href="/assets/js/10.c524dfdd.js" as="script"><link rel="prefetch" href="/assets/js/3.4b56ecab.js"><link rel="prefetch" href="/assets/js/4.cf9ea75d.js"><link rel="prefetch" href="/assets/js/5.d2773c15.js"><link rel="prefetch" href="/assets/js/6.a7a6a0d9.js"><link rel="prefetch" href="/assets/js/7.44486ff1.js"><link rel="prefetch" href="/assets/js/8.4b83fec6.js"><link rel="prefetch" href="/assets/js/9.4839daec.js">
<link rel="stylesheet" href="/assets/css/0.styles.e4d8b86b.css">
</head>
<body>
<div id="app" data-server-rendered="true"><div class="theme-container no-sidebar"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" aria-current="page" class="home-link router-link-exact-active router-link-active"><!----> <span class="site-name">测试</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <!----></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><!----> <!----> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="测试课程教案"><a href="#测试课程教案" class="header-anchor">#</a> 测试课程教案</h1> <h2 id="mysql"><a href="#mysql" class="header-anchor">#</a> mysql</h2> <h2 id="http"><a href="#http" class="header-anchor">#</a> http</h2> <h2 id="flask"><a href="#flask" class="header-anchor">#</a> flask</h2> <h2 id="linux"><a href="#linux" class="header-anchor">#</a> linux</h2></div> <footer class="page-edit"><!----> <!----></footer> <!----> </main></div><div class="global-ui"></div></div>
<script src="/assets/js/app.44f0a4c8.js" defer></script><script src="/assets/js/2.ed656cef.js" defer></script><script src="/assets/js/10.c524dfdd.js" defer></script>
</body>
</html>

35
docs/.vuepress/dist/mysql/create.html vendored Normal file

File diff suppressed because one or more lines are too long

18
docs/.vuepress/dist/mysql/index.html vendored Normal file

File diff suppressed because one or more lines are too long

26
docs/.vuepress/dist/mysql/install.html vendored Normal file

File diff suppressed because one or more lines are too long

9
docs/README.md Normal file
View File

@@ -0,0 +1,9 @@
# 测试课程教案
## mysql
## http
## flask
## linux

55
docs/mysql/README.md Normal file
View File

@@ -0,0 +1,55 @@
# mysql
> 这一章节主要是介绍mysql是什么
## 什么是数据库
数据库Database是按照数据结构来组织、存储和管理数据的仓库。
每个数据库都有一个或多个不同的 API 用于创建,访问,管理,搜索和复制所保存的数据。
我们也可以将数据存储在文件中,但是在文件中读写数据速度相对较慢。
所以现在我们使用关系型数据库管理系统RDBMS来存储和管理大数据量。所谓的关系型数据库是建立在关系模型基础上的数据库借助于集合代数等数学概念和方法来处理数据库中的数据。
RDBMS 即关系数据库管理系统(Relational Database Management System)的特点:
1. 数据以表格的形式出现
2. 每行为各种记录名称
3. 每列为记录名称所对应的数据域
4. 许多的行和列组成一张表单
5. 若干的表单组成database
> 可以理解为数据库就是一个文件夹,文件夹中存放的是excel一条数据就是excel中的一行。
## RDBMS 术语
在我们开始学习MySQL 数据库前让我们先了解下RDBMS的一些术语
- 数据库: 数据库是一些关联表的集合。
- 数据表: 表是数据的矩阵。在一个数据库中的表看起来像一个简单的电子表格。
- 列: 一列(数据元素) 包含了相同类型的数据, 例如邮政编码的数据。
- 行:一行(=元组,或记录)是一组相关的数据,例如一条用户订阅的数据。
- 冗余:存储两倍数据,冗余降低了性能,但提高了数据的安全性。
- 主键:主键是唯一的。一个数据表中只能包含一个主键。你可以使用主键来查询数据。
- 外键:外键用于关联两个表。
- 复合键:复合键(组合键)将多个列作为一个索引键,一般用于复合索引。
- 索引:使用索引可快速访问数据库表中的特定信息。索引是对数据库表中一列或多列的值进行排序的一种结构。类似于书籍的目录。
- 参照完整性: 参照的完整性要求关系中不允许引用不存在的实体。与实体完整性是关系模型必须满足的完整性约束条件,目的是保证数据的一致性。
MySQL 为关系型数据库(Relational Database Management System), 这种所谓的"关系型"可以理解为"表格"的概念, 一个关系型数据库由一个或数个表格组成
![图 2](../../images/00df26e1b5cd3a6b58b904c18540cce2a036d9cbb6d4b64f436c217a701eb945.png)
## MySQL数据库
MySQL 是一个关系型数据库管理系统,由瑞典 MySQL AB 公司开发,目前属于 Oracle 公司。MySQL 是一种关联数据库管理系统,关联数据库将数据保存在不同的表中,而不是将所有数据放在一个大仓库内,这样就增加了速度并提高了灵活性。
- MySQL 是开源的,目前隶属于 Oracle 旗下产品。
- MySQL 支持大型的数据库。可以处理拥有上千万条记录的大型数据库。
- MySQL 使用标准的 SQL 数据语言形式。
- MySQL 可以运行于多个系统上,并且支持多种语言。这些编程语言包括 C、C++、Python、Java、Perl、PHP、Eiffel、Ruby 和 Tcl 等。
- MySQL 支持大型数据库,支持 5000 万条记录的数据仓库32 位系统表文件最大可支持 4GB64 位系统支持最大的表文件为8TB。
- MySQL 是可以定制的,采用了 GPL 协议,你可以修改源码来开发自己的 MySQL 系统。
> 下一章节将会开始安装mysql

176
docs/mysql/create.md Normal file
View File

@@ -0,0 +1,176 @@
# 数据库的链接与创建
先看下如何连接数据库安装完成之后用windows键 就是徽标键 + r键打开运行输入cmd然后回车
![图 1](../../images/7809b6c265ba80888a4c95a5408ce43acbe4e6d7cbb8726199a07c5a3b2eaa14.png)
然后输入`mysql -uroot -p` ,然后回车
![图 2](../../images/3fd6e19a87b86f06de742f498a5f04af1872ed6b11203ef63073eff799dd7b65.png)
然后输入你安装时候输入的密码,然后回车
![图 3](../../images/7129161c3e27345a6643cc2cc364ba9a09f8bb684dc12f6b091be788b2a44405.png)
这样就连接到数据库了
## 查看所有数据库
之前说了mysql中有数据库与数据表数据库中包含着数据表。
那么如何查看现在存在的数据库呢?
```sql
show databases;
```
使用上面的命令可以查看当前存在的数据库。
![图 4](../../images/a5269ab84de9e0260048d104570277d23da61b531f5a83dc9fc92a0230e472f9.png)
> 注意,每条语句后面必须跟;结尾,而且保证是英文的分号
每个刚安装好的mysql都会有自带的这四个数据库一般我们不会修改他们之后用到的时候在进行解释如果随便修改他们会造成一些意料之外的事情。
所以我们如何创建我们自己的数据库呢?
```sql
create database demo;
```
上面的命令是创建了一个名字为demo的数据库
那么名字是怎么定义的呢?
```sql
create database ;
```
比如我们要创建一个叫school的数据库就应该使用
```sql
create database school;
```
那么我们运行`create database demo;`之后,再次查看数据库会怎么样?
![图 5](../../images/f30f69af00f9be969676bc9a58622109c78f6f18963842e3d0ba8693efc5bf65.png)
发现数据库列表多了一个demo
我们执行下`create database school;`会怎么样呢?
![图 6](../../images/79bf2d49cee9a4d88b60905ee7d9bb8f0fde585261e8127124d12976954931f4.png)
school数据库也出现了。
所以这就是创建数据库的方法。
数据库创建好了,那么如何创建表呢?
之前说了,表是存在于数据库里面的,我们创建的时候应该指定要在哪个数据库中创建,就是新建文件一样,我们需要打开要新建文件的文件夹。
所以如何打开数据库呢?
```sql
use ;
```
使用use来选择要操作的数据库。
比如我们要在school数据库里面创建一个class的表那么我们就应该先使用use来选择school这个数据库
```sql
use school;
```
![图 7](../../images/6ee4b374da0e39869bb6e4372fb47ddcf37dcf493abcdc0e82296b09b3e22c11.png)
使用use之后会出现`Database changed` 就是数据库已经选择了,可以进行之后的操作了。
那么先查看一下有没有数据表,因为是新建立的数据库,所以应该是空白的。
那么如何查看呢?
```sql
show tables;
```
![图 8](../../images/861ff14d3f432f0d75e938eeb6acb04e54d182d26cdc23901acee70126426c71.png)
并没有出现什么,因为最初创建的数据库是空白的,我们应该新建一个表。
如何创建一个表呢,是跟创建数据库一样直接`create table 表名;`吗?
并不是,介绍的时候有说到,数据表包含
- 表名
- 表字段名
- 字段类型
- 约束等等
## 类型
那么我们先看一下类型。
> MySQL支持多种类型大致可以分为三类数值、日期/时间和字符串(字符)类型。
数值是 int float double等
字符串是 varchar char text等
日期时间是 date datetime等
下面详细介绍一下,
int 是整数,可以存放一些整数的值 比如 123 2345 这种整数等 范围是(-2 147 483 6482 147 483 647)
float 是小数,是存放小数的,可以存放小数 比如 3.14 2.345 等等 可以有6 - 7 位的准确值
double 是双精度小数型,也是存放小数 但是精准度比float好可以保证 15 - 16 为准确性
data 是存放日期的格式为YYYY-MM-DD例如 2020-02-02 2021-04-29 等等
datatime 存放日期时间的 格式为YYYY-MM-DD HH:MM:SS 例如 2020-02-02 02:02:02 就是年-月-日 时:分:秒
char 定长字符串定义的时候需要传入长度char(10) 定义一个长度为10的字符类型
varchar 变长字符串与char一样但是有一些区别在下面解释
### char 与 varchar
1. char类型时定长的类型即当定义的是char(10),输入的是"abc"这三个字符时它们占的空间一样是10个字节包括7个空字节。当输入的字符长度超过指定的数时char会截取超出的字符。而且当存储char值时MySQL是自动删除输入字符串末尾的空格。
2. char是适合存储很短的、一般固定长度的字符串。例如char非常适合存储密码的MD5值因为这是一个定长的值。对于非常短的列char比varchar在存储空间上也更有效率。
3. varchar(n)类型用于存储可变长的比如varchar(10), 然后输入abc三个字符那么实际存储大小为3个字节。
4. 所以从空间上考虑varcahr较合适从效率上考虑用char合适。二者之间需要权衡。
## 创建数据表
那么如何简单的创建一个表呢?
```sql
create table ( , ,.....);
```
例如,我们要创建一个下面样式的表
![图 9](../../images/6198f490d8cdf27a32d506e3c1550d21f2ddd3e956d9b8e3248cca3c03d0b4c0.png)
我们先考虑一下名字与类型,因为数据库中不能用中文作为字段名,所以我们需要给起一个英文名
- 姓名 name 类型是 varchar 长度给10 因为名字是字符串 并且没有人会有10个字的名字可能会有5个6个.
- 性别 sex 类型是varchar 长度给2 性别一般是男 女 未知,在一般项目中可能会用数字代替。
- 年龄 age 类型 int
那么我们接下来创建这个表表名就叫class
```sql
create table class(name varchar(10),sex varchar(2),age int);
```
执行一下
![图 10](../../images/7d4dd4c17f53ebe96e4e2457c862e41b8972b97c1278f4924303898289c0b09c.png)
完成了,然后再查看一下当前数据库的表
![图 11](../../images/abc9d1762271712283ecbc0bab169e8faf876d4e140caa4f11bfd92b8b336f9e.png)
已经可以看到我们创建的class了
下节就是数据的增删改查了。

96
docs/mysql/insert.md Normal file
View File

@@ -0,0 +1,96 @@
# 数据操作
## 插入数据
上面已经创建了一个class表表的格式为
| name | sex | age |
| ---- | ---- | ---- |
所以应该如何添加数据呢?
```sql
insert into (,,....) value(,,...);
```
添加数据就是使用上面的格式。
所以class表添加数据的方法就是
```sql
insert into class(name,sex,age) value("张三","",20);
```
![图 1](../../images/d0563dc7845cb598cb300066e182aa2067e3fc6216946703fbb6c587a0078c49.png)
出现这样就是添加成功了
虽然到这里应该还有很多疑问,但是没办法一时解释清楚,请带着疑问走下去。
## 查询数据
已经插入数据了,那么如何查看呢?
```sql
select * from ;
```
这样就是查询数据的方法,让我们来试一下。
```sql
select * from class;
```
![图 2](../../images/4cdefb4aeb27679d91dd50227a7d2efc117dc1f60effabd42677dc9d0dfbdbe9.png)
看到了我们的数据已经出现在里面了,那么插入的数据都已经成功了。
## 插入数据详解
下面详细来了解一下插入数据的语句
```sql
insert into (,,....) value(,,...);
```
表名就可以不用说了,那么后面的字段名如何写呢?
### 必须是表中含有的字段
就像我们现在的class表只有name sex 与 age 这三个字段,所以插入的时候是`(name,sex,age)`
如果写一个不存在的字段就会报错比如下面我们写一个classname
```sql
insert info class(name,sex,age,classname) value("李三","",20,"一班");
```
![图 1](../../images/13ee6d4bd67ad0887098ee2a3ff5cb2ecae4245492c9f7914737eda82c445b8b.png)
现在就报错了
>ERROR 1064 (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 'class(name,sex,age,classname) value("李三","男",20,"一班")' at line 1
翻译一下
> 错误106442000您的SQL语法有错误请查看与您的MySQL服务器版本对应的手册以了解使用“classnamesexageclassnamevalue”李三","男",20,"一班")' 在1号线
sql语法错误了不能写表内没有的字段
### 可以省略一些字段
举个例子
```sql
insert class(name) value("李四");
```
![图 2](../../images/05744f66e8ff044dfd7d26b6c5173b6d38e26946dee5866ab28ef6d090885620.png)
可以成功
查询一下
![图 3](../../images/cf4c2d67f9e61957ecd9e0b15f88708fa1b082c8466fe58e87f47c6fdd77c857.png)
只有名字 其他的都是null

58
docs/mysql/install.md Normal file
View File

@@ -0,0 +1,58 @@
# 安装
> 这是mysql8.0 安装与5.7是一样的如果要安装5.7就下载5.7的安装包就可以安装mysql并不需要多么复杂
1. 进入mysql官网
- [mysql](https://www.mysql.com/)
2. 点击下载
- ![图 3](../../images/fdd4fee53a93fde16d2ba7309135168feb173c326993418e19c3f94d3c116f3b.png)
3. 在下面选择社区版下载
- ![图 4](../../images/7e5a04d758e4361112ee2891c4850af08b21a704777e6b15194d944d5af41910.png)
4. 选择for windows
- ![图 5](../../images/55e66acf998906244fc6c571932d73902720edef447c179ae7df10f3e58d8a55.png)
5. 然后选择离线安装包
- ![图 6](../../images/909d60db911bdcf313d57447f4f9c40aebbb76fb1489c347058b1bb488e13153.png)
6. 下载完成之后,双击打开安装包
- ![图 7](../../images/a8fa791cc994f25ae5de06e083945b076196cccdb5611ed6aa3a0e9acfdf2335.png)
- ![图 8](../../images/ce5715722c278def571a2b47385c4f20073d8814308467c1bc847e33645a3357.png)
- 这一部分可能需要稍等一会
- ![图 9](../../images/b2a15e25662699d411ff83bcb16931ac0057020105d2153f086266c8cff2751f.png)
7. 选择最后一个然后点击next下面将会详细说明每个选项的作用
- ![图 10](../../images/a3809c4ca927864600f0a26ea03ee3ec33590c3b601bf5e7c1e3840482dbdcad.png)
8. 选择要安装的
- 依次点击前面的+符号,依次展开
- ![图 11](../../images/e0d830ded7692407b17866e8f26fad52d44ae59f614f134d0352282874689c82.png)
- ![图 12](../../images/21bff5dbebd405682821ebb0aef17fd022a700065fd3d2140e5e783e2b410837.png)
- ![图 13](../../images/5a6a811141e4a5456579ee5193df7205cc4dfbf08399498943d62ccfcb360085.png)
- ![图 14](../../images/4a578c31662d74b3b082f42a95e24fe30d27bcc028e2d712ab213fbd8665335e.png)
- 然后点击下面的next
- ![图 15](../../images/0b0a6ba93ba6d73b3562ea7295015bedda4c2732a0f469b5571f70341d4b3304.png)
- 点击下面的execute
- ![图 16](../../images/3fd8c8747b41f570f4247b21aa09cf72422e80a84a009ed471b5ce78f4250819.png)
- ![图 17](../../images/cfe9977fbfeddca38f1eeaef7900cc3ff9cb1ed78222abfa307279e956a6463c.png)
- 等待安装完成点击next
- ![图 18](../../images/10f9a1947532d6b1a6a656cd3c2f737c15583410c3c1d525fa42916a93a2ee08.png)
- 再次点击next
- ![图 19](../../images/d74e16d964e198815b99eb1cabf5d791a233d1474f684d5765ade78d109e69f8.png)
- 这一步也直接选择next
- ![图 20](../../images/f98a20938db19ec28342a133851a6e1f940f946f92b94627c53016b01afb035f.png)
- 也是直接next
- ![图 21](../../images/109803903c7da24728c2352a22bcec10532821af555391dca63e4df6711912c6.png)
- 这一步需要输入密码,下面那个是重复输入密码
- ![图 22](../../images/73f5be87126aeafc73f576444d082c2f730370b8f23c0a909610b2929d602dfc.png)
- 输入完成之后下面的next就会亮起来这个密码一定要记住后面链接会用到可以理解为登录密码
- ![图 23](../../images/cf02599b8990fa11782de4c964adb701952f5436df7e35bece5384469096114f.png)
- 这一步也直接next
- ![图 24](../../images/e1ef3c975827b39be2fd46487151758f4444659b7fb7523dee4ebb122e0e53da.png)
- 这一步点击execute
- ![图 25](../../images/d6d56f66e96efe02c1b8b670cc77dd9232782e9822ebf57d9aeedcfbe3700e29.png)
- 等待完成
- ![图 26](../../images/6805154265ae857950fcc89e861200b06e253b3273b175d844056cd04328e5e9.png)
- 完成之后点击finish
- ![图 28](../../images/9bbeeca183993938191244103e8e8d309bc46ba8be11d91aaa1a8ea4e113f990.png)
- 点击next
- ![图 29](../../images/4bff722ee325588303c4f08bdb5825909ce8f1f2d08a49743283ab5f5e8c9304.png)
- 点击finish
- ![图 30](../../images/0102b8a545925f23bc7a13ba377868152f27a97922b97710c1123fe828f8790e.png)
- 然后就安装成功了

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

13
package.json Normal file
View File

@@ -0,0 +1,13 @@
{
"name": "vuepress",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"devDependencies": {
"vuepress": "^1.8.2"
},
"scripts": {
"dev": "vuepress dev docs",
"build": "vuepress build docs"
}
}

7932
yarn.lock Normal file

File diff suppressed because it is too large Load Diff