-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
384 lines (281 loc) · 34.4 KB
/
index.html
1
2
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>mhduiy</title><meta name="author" content="艾洋"><meta name="copyright" content="艾洋"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="艾洋的小站">
<meta property="og:type" content="website">
<meta property="og:title" content="mhduiy">
<meta property="og:url" content="http://mhduiy.top/index.html">
<meta property="og:site_name" content="mhduiy">
<meta property="og:description" content="艾洋的小站">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://mhduiy-1310556463.cos.ap-chongqing.myqcloud.com/img/1666233354606.jpg">
<meta property="article:author" content="艾洋">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://mhduiy-1310556463.cos.ap-chongqing.myqcloud.com/img/1666233354606.jpg"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="http://mhduiy.top/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
root: '/',
algolia: undefined,
localSearch: {"path":"/search.xml","preload":false,"languages":{"hits_empty":"找不到您查询的内容:${query}"}},
translate: undefined,
noticeOutdate: undefined,
highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
copy: {
success: '复制成功',
error: '复制错误',
noSupport: '浏览器不支持'
},
relativeDate: {
homepage: false,
post: false
},
runtime: '天',
date_suffix: {
just: '刚刚',
min: '分钟前',
hour: '小时前',
day: '天前',
month: '个月前'
},
copyright: {"limitCount":80,"languages":{"author":"作者: 艾洋","link":"链接: ","source":"来源: mhduiy","info":"著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。"}},
lightbox: 'fancybox',
Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#1f1f1f","position":"bottom-left"},
source: {
justifiedGallery: {
js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
}
},
isPhotoFigcaption: false,
islazyload: false,
isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
title: 'mhduiy',
isPost: false,
isHome: true,
isHighlightShrink: false,
isToc: false,
postUpdate: '2023-03-01 00:04:20'
}</script><noscript><style type="text/css">
#nav {
opacity: 1
}
.justified-gallery img {
opacity: 1
}
#recent-posts time,
#post-meta time {
display: inline !important
}
</style></noscript><script>(win=>{
win.saveToLocal = {
set: function setWithExpiry(key, value, ttl) {
if (ttl === 0) return
const now = new Date()
const expiryDay = ttl * 86400000
const item = {
value: value,
expiry: now.getTime() + expiryDay,
}
localStorage.setItem(key, JSON.stringify(item))
},
get: function getWithExpiry(key) {
const itemStr = localStorage.getItem(key)
if (!itemStr) {
return undefined
}
const item = JSON.parse(itemStr)
const now = new Date()
if (now.getTime() > item.expiry) {
localStorage.removeItem(key)
return undefined
}
return item.value
}
}
win.getScript = url => new Promise((resolve, reject) => {
const script = document.createElement('script')
script.src = url
script.async = true
script.onerror = reject
script.onload = script.onreadystatechange = function() {
const loadState = this.readyState
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
script.onload = script.onreadystatechange = null
resolve()
}
document.head.appendChild(script)
})
win.activateDarkMode = function () {
document.documentElement.setAttribute('data-theme', 'dark')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
}
}
win.activateLightMode = function () {
document.documentElement.setAttribute('data-theme', 'light')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
}
}
const t = saveToLocal.get('theme')
if (t === 'dark') activateDarkMode()
else if (t === 'light') activateLightMode()
const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
if (asideStatus === 'hide') {
document.documentElement.classList.add('hide-aside')
} else {
document.documentElement.classList.remove('hide-aside')
}
}
const detectApple = () => {
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
document.documentElement.classList.add('apple')
}
}
detectApple()
})(window)</script><meta name="generator" content="Hexo 6.3.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://mhduiy-1310556463.cos.ap-chongqing.myqcloud.com/img/1666233354606.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">7</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">2</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标籤</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fa fa-heartbeat"></i><span> 清单</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/Gallery/"><i class="fa-fw fas fa-images"></i><span> 照片</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('https://mhduiy-1310556463.cos.ap-chongqing.myqcloud.com/img/06613ddea21112fa6814d49565f3c110.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">mhduiy</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标籤</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fa fa-heartbeat"></i><span> 清单</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/Gallery/"><i class="fa-fw fas fa-images"></i><span> 照片</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">mhduiy</h1><div id="site-subtitle"><span id="subtitle"></span></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left"><a href="/2023/02/27/DTK%E5%A3%81%E7%BA%B8%E7%AE%A1%E7%90%86%E5%99%A8%E4%BD%BF%E7%94%A8%E6%96%87%E6%A1%A3/" title="DTK壁纸管理器使用文档"><img class="post_bg" src="https://mhduiy-1310556463.cos.ap-chongqing.myqcloud.com/img/a5f37c547f455c6c3de14177dc90a745.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="DTK壁纸管理器使用文档"></a></div><div class="recent-post-info"><a class="article-title" href="/2023/02/27/DTK%E5%A3%81%E7%BA%B8%E7%AE%A1%E7%90%86%E5%99%A8%E4%BD%BF%E7%94%A8%E6%96%87%E6%A1%A3/" title="DTK壁纸管理器使用文档">DTK壁纸管理器使用文档</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2023-02-27T15:16:30.000Z" title="发表于 2023-02-27 23:16:30">2023-02-27</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/C/">C++</a></span></div><div class="content">简介本项目是一个壁纸管理器的Demo,使用了DIconButton,DSpinner,DImageViewer等 DTK组件,可以查看本地系统壁纸和在线的壁纸,还可以可以实现查看壁纸大图,保存图片设置壁纸等功能
github仓库:https://github.com/mhduiy/DTKWallpaperManager
构建步骤1234mkdir buildcd buildcmake ..make
详细开发文档一、安装dtk组件因为项目采用许多dtk组件,需要我们提前安装好dtk的各种核心库和依赖
方法一一句命令即可安装Dtk相关开发环境
libdtk{core,widget,gui}-dev 等价于 deepin-sdk
1sudo apt install deepin-sdk qtcreator-template-dtk
方法二安装 dtkcommon12345678git clone https://github.com/linuxdeepin/dtkcommon.git -b 5.6.4cd dtkcommon# 安装依赖sudo apt build-d ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2022/10/20/C++%E4%B9%8BSTL%E5%AE%B9%E5%99%A8/" title="C++之STL容器"><img class="post_bg" src="https://mhduiy-1310556463.cos.ap-chongqing.myqcloud.com/img/a5f37c547f455c6c3de14177dc90a745.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="C++之STL容器"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/10/20/C++%E4%B9%8BSTL%E5%AE%B9%E5%99%A8/" title="C++之STL容器">C++之STL容器</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-10-19T17:16:30.000Z" title="发表于 2022-10-20 01:16:30">2022-10-20</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/C/">C++</a></span></div><div class="content">面向对象的三大特征:封装,继承和多态
STL提高了泛用性,复用性
STL从广义上分为三大块:容器,算法和迭代器,容器和算法通过迭代器无缝连接
STL几乎所有的代码都采用了模板类和模板函数
1 STL的六大组件
容器,算法,迭代器,仿函数,适配器(配接器),空间配置器
容器:各种数据结构:vector,list,deque,set,map
算法:各种常用的算法,sort,find(查找),copy(拷贝),for_each(遍历)
迭代器:链接容器和算法
仿函数(重载小括号):行为类似函数,可作为算法的某种策略
适配器:一种修饰容器或者仿函数或迭代器接口的东西
空间配置器:负责空间的配置和管理
2 容器,算法,迭代器容器分为序列式容器和关联式容器
序列式容器:强调值的排序,容器内每个元素都有固定的位置(怎么放:位置就固定)
关联式容器:二叉树结构,各个元素之间没有严格物理上的顺序关系
算法氛围质变算法和非质变算法
质变算法:运算过程中会更改区间内元素的内容,拷贝,替换,删除
非质变函数:算法过程中不会更改区间内的元素,查找,计数,遍历,寻找极值
迭代器
提供一种方法, ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2022/10/20/C++%E4%B9%8Bcmake/" title="之cmake"><img class="post_bg" src="https://mhduiy-1310556463.cos.ap-chongqing.myqcloud.com/img/a5f37c547f455c6c3de14177dc90a745.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="之cmake"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/10/20/C++%E4%B9%8Bcmake/" title="之cmake">之cmake</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-10-19T17:16:30.000Z" title="发表于 2022-10-20 01:16:30">2022-10-20</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/C/">C++</a></span></div><div class="content">c++之CMake-VSCode部分笔记来源:
https://www.bilibili.com/video/BV1fy4y1b7TC/?spm_id_from=333.337.search-card.all.click&vd_source=38bec47829bb3eb62135db732b74499d
CMake是一个跨平台的安装编译工具,可以用简单的语句来描述所有平台的安装(编译过程)。
CMake可以说已经成为大部分C++开源项目标配
语法特性介绍
基本语法格式:指令(参数 1 参数 2…)
参数使用括弧括起
参数之间使用空格或分号分开
指令是大小写无关的,参数和变量是大小写相关的
123set(HELLO hello.cpp)add_executable(hello main.cpp hello.cpp)ADD_EXECUTABLE(hello main.cpp ${HELLO})
变量使用${}方式取值,但是在 IF 控制语句中是直接使用变量名
重要指令和CMake常用变量
cmake_minimum_required - 指 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2022/10/20/C++%E6%99%BA%E8%83%BD%E6%8C%87%E9%92%88/" title="C++智能指针"><img class="post_bg" src="https://mhduiy-1310556463.cos.ap-chongqing.myqcloud.com/img/a5f37c547f455c6c3de14177dc90a745.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="C++智能指针"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/10/20/C++%E6%99%BA%E8%83%BD%E6%8C%87%E9%92%88/" title="C++智能指针">C++智能指针</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-10-19T17:16:30.000Z" title="发表于 2022-10-20 01:16:30">2022-10-20</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/C/">C++</a></span></div><div class="content">c++有两种指针:原始指针和智能指针 智能指针是原始指针的封装,优点是会自动的分配内存,不用担心潜在的内存泄露
关于智能指针在c++11中通过引用智能指针的概念,使得程序员不需要手动释放内存
智能指针的种类
std::unique_ptr
std::shared_ptr
std::weak_ptr
注意
std::auto_ptr已经被废弃
智能指针和原始指针
并不是所有的指针都可以封装为指针指针,有的时候原始指针比智能指针更加方便
最常用的是裸指针,其次是unique_ptr和shared_ptr
weak_ptr是shared_ptr的一个补充,应用场景比较少
智能指针只是解决了一部分问题,没有从根本上解决C++内存安全的问题,不加以使用依然会造成内存安全的问题
独占指针:unique_ptr
用得最多的一个
在任何给定的时刻,只能有一个指针释放内存
当指针超过作用域后,内存将会自动释放
该类型指针不能copy只能move
三种创建方式
通过已用的裸指针进行创建:建议将裸指针置空消除掉
通过new创建
std::make_unique创建(推荐)
特点
unique ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2022/10/20/C++%E7%BC%96%E8%AF%91%E5%91%BD%E4%BB%A4/" title="C++编译命令"><img class="post_bg" src="https://mhduiy-1310556463.cos.ap-chongqing.myqcloud.com/img/a5f37c547f455c6c3de14177dc90a745.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="C++编译命令"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/10/20/C++%E7%BC%96%E8%AF%91%E5%91%BD%E4%BB%A4/" title="C++编译命令">C++编译命令</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-10-19T17:16:30.000Z" title="发表于 2022-10-20 01:16:30">2022-10-20</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/C/">C++</a></span></div><div class="content">c++之编译命令
gcc和g++是GNU中最流行的c&c++编译器
对于 .c和.cpp文件,gcc分别当做c和cpp文件编译(cpp的语法规则比c的更强一些) &#x20;对于 .c和.cpp文件,g++则统一当做cpp文件编译
编译的四个阶段
预处理:编译处理宏定义等命令,生成.i文件
编译:将预处理后的文件转换为汇编语言,生成.s文件
汇编:由汇编文件翻译为二进制目标文件,生成.o文件或者.obj文件(Windows)
链接:多个二进制目标文件结合库函数合成独立执行的执行文件.out,或者.exe
📌c++的编译原则:c++编译遵循独立编译原则,每个文件单独编译,每一个文件生成对于的目标文件.o,一个cpp文件中的函数调用,编译器会寻找其实现,如果没有找到(有可能在其他文件中实现),就用一个符号代替,之后交给连接器来找对应函数的实现,这个时候如果找不到就会报错。
📌函数模板的编译:编译器会对函数模板进行二次编译,在声明函数模板的地方进行一次编译,在调用的地方在编译一次,声明是不会编译的,cpp文件才进行编译,模板类是两次编译的,编译模板的 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2022/10/20/SQL%E8%AF%AD%E5%8F%A5/" title="SQL语句"><img class="post_bg" src="https://mhduiy-1310556463.cos.ap-chongqing.myqcloud.com/img/a5f37c547f455c6c3de14177dc90a745.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="SQL语句"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/10/20/SQL%E8%AF%AD%E5%8F%A5/" title="SQL语句">SQL语句</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-10-19T17:16:30.000Z" title="发表于 2022-10-20 01:16:30">2022-10-20</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/other/">other</a></span></div><div class="content">目录
服务的启动和停止
MySQL的链接
SQL通用语法
SQL分类
DDL-数据定义语言
DDL-表操作
DML-增删改
DQL-查询
基本查询:
条件查询:
聚合函数:
SQL语言服务的启动和停止启动:net start mysql
停止:net stop mysql
进入服务管理:services.msc
MySQL的链接mysql -h 127.0.0.1 -P 3306 -u root -p
SQL通用语法
SQL语句可以单行多行书写,以分号结尾
可以使用空格或者缩进
MySQL数据库的SQL语句不区分大小学,但是建议使用大写
注释:
单行注释:--或者#
多行注释:/**/
SQL分类
DDL:数据定义语言
DML:增删改
DQL:查询
DCL:数据控制语言,创建用户,修改用户的权限
DDL-数据定义语言
查询
查询所有数据库:SHOW DATABASES;
查询当前数据库:SELECT DATABASE();
创建
CREATE DATABASE [ IF NOT EXISTS ] ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2022/10/20/UOS%E9%85%8D%E7%BD%AE%E5%9B%BE%E5%BA%8A/" title="UOS配置图床"><img class="post_bg" src="https://mhduiy-1310556463.cos.ap-chongqing.myqcloud.com/img/a5f37c547f455c6c3de14177dc90a745.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="UOS配置图床"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/10/20/UOS%E9%85%8D%E7%BD%AE%E5%9B%BE%E5%BA%8A/" title="UOS配置图床">UOS配置图床</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-10-19T17:16:30.000Z" title="发表于 2022-10-20 01:16:30">2022-10-20</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/other/">other</a></span></div><div class="content">
前提条件:
安装nodejs
安装npm
安装picgo1sudo npm install picgo -g
picgo安装位置:/usr/local/lib/node_modules/picgo
检验安装1picgo -v
编写配置文件1234567891011121314151617181920212223242526272829303132333435363738394041424344# 文件 .config.josn# 路径 ~/.picgo/config.json# 方式 腾讯云{ "picBed": { "current": "tcyun", "uploader": "tcyun", "smms": { "token": "" }, "tcyun": { "appId&qu ...</div></div></div><nav id="pagination"><div class="pagination"><span class="page-number current">1</span></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://mhduiy-1310556463.cos.ap-chongqing.myqcloud.com/img/1666233354606.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">艾洋</div><div class="author-info__description">艾洋的小站</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">7</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">0</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">2</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2023/02/27/DTK%E5%A3%81%E7%BA%B8%E7%AE%A1%E7%90%86%E5%99%A8%E4%BD%BF%E7%94%A8%E6%96%87%E6%A1%A3/" title="DTK壁纸管理器使用文档"><img src="https://mhduiy-1310556463.cos.ap-chongqing.myqcloud.com/img/a5f37c547f455c6c3de14177dc90a745.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="DTK壁纸管理器使用文档"/></a><div class="content"><a class="title" href="/2023/02/27/DTK%E5%A3%81%E7%BA%B8%E7%AE%A1%E7%90%86%E5%99%A8%E4%BD%BF%E7%94%A8%E6%96%87%E6%A1%A3/" title="DTK壁纸管理器使用文档">DTK壁纸管理器使用文档</a><time datetime="2023-02-27T15:16:30.000Z" title="发表于 2023-02-27 23:16:30">2023-02-27</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/10/20/C++%E4%B9%8BSTL%E5%AE%B9%E5%99%A8/" title="C++之STL容器"><img src="https://mhduiy-1310556463.cos.ap-chongqing.myqcloud.com/img/a5f37c547f455c6c3de14177dc90a745.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="C++之STL容器"/></a><div class="content"><a class="title" href="/2022/10/20/C++%E4%B9%8BSTL%E5%AE%B9%E5%99%A8/" title="C++之STL容器">C++之STL容器</a><time datetime="2022-10-19T17:16:30.000Z" title="发表于 2022-10-20 01:16:30">2022-10-20</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/10/20/C++%E4%B9%8Bcmake/" title="之cmake"><img src="https://mhduiy-1310556463.cos.ap-chongqing.myqcloud.com/img/a5f37c547f455c6c3de14177dc90a745.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="之cmake"/></a><div class="content"><a class="title" href="/2022/10/20/C++%E4%B9%8Bcmake/" title="之cmake">之cmake</a><time datetime="2022-10-19T17:16:30.000Z" title="发表于 2022-10-20 01:16:30">2022-10-20</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/10/20/C++%E6%99%BA%E8%83%BD%E6%8C%87%E9%92%88/" title="C++智能指针"><img src="https://mhduiy-1310556463.cos.ap-chongqing.myqcloud.com/img/a5f37c547f455c6c3de14177dc90a745.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="C++智能指针"/></a><div class="content"><a class="title" href="/2022/10/20/C++%E6%99%BA%E8%83%BD%E6%8C%87%E9%92%88/" title="C++智能指针">C++智能指针</a><time datetime="2022-10-19T17:16:30.000Z" title="发表于 2022-10-20 01:16:30">2022-10-20</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/10/20/C++%E7%BC%96%E8%AF%91%E5%91%BD%E4%BB%A4/" title="C++编译命令"><img src="https://mhduiy-1310556463.cos.ap-chongqing.myqcloud.com/img/a5f37c547f455c6c3de14177dc90a745.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="C++编译命令"/></a><div class="content"><a class="title" href="/2022/10/20/C++%E7%BC%96%E8%AF%91%E5%91%BD%E4%BB%A4/" title="C++编译命令">C++编译命令</a><time datetime="2022-10-19T17:16:30.000Z" title="发表于 2022-10-20 01:16:30">2022-10-20</time></div></div></div></div><div class="card-widget card-categories"><div class="item-headline">
<i class="fas fa-folder-open"></i>
<span>分类</span>
</div>
<ul class="card-category-list" id="aside-cat-list">
<li class="card-category-list-item "><a class="card-category-list-link" href="/categories/C/"><span class="card-category-list-name">C++</span><span class="card-category-list-count">5</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/other/"><span class="card-category-list-name">other</span><span class="card-category-list-count">2</span></a></li>
</ul></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2023/02/"><span class="card-archive-list-date">二月 2023</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/10/"><span class="card-archive-list-date">十月 2022</span><span class="card-archive-list-count">6</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">7</div></div><div class="webinfo-item"><div class="item-name">已运行时间 :</div><div class="item-count" id="runtimeshow" data-publishDate="2022-10-18T16:00:00.000Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站总字数 :</div><div class="item-count">16.8k</div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2023-02-28T16:04:19.914Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">©2020 - 2023 By 艾洋</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a><br/><a target="_blank" rel="noopener" href="https://beian.miit.gov.cn/">
鄂ICP备2022015453号-1</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span> 数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script src="/js/search/local-search.js"></script><script>var preloader = {
endLoading: () => {
document.body.style.overflow = 'auto';
document.getElementById('loading-box').classList.add("loaded")
},
initLoading: () => {
document.body.style.overflow = '';
document.getElementById('loading-box').classList.remove("loaded")
}
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"><script>function subtitleType () {
if (true) {
window.typed = new Typed("#subtitle", {
strings: ["今日事,今日毕","和过去说声拜拜,和未来说声安好","泪水不是为了排除外在的悲伤,而是为了自由的哭泣","无论去哪儿,什么天气,记得带上自己的阳光","生活就是一场逃亡,不能坐以待毙","早上长睡不起,晚上视睡如归"],
startDelay: 300,
typeSpeed: 150,
loop: true,
backSpeed: 50
})
} else {
document.getElementById("subtitle").innerHTML = '今日事,今日毕'
}
}
if (true) {
if (typeof Typed === 'function') {
subtitleType()
} else {
getScript('https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js').then(subtitleType)
}
} else {
subtitleType()
}</script></div><canvas class="fireworks" mobile="false"></canvas><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/fireworks.min.js"></script><script defer="defer" id="ribbon" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-ribbon.min.js" size="150" alpha="0.6" zIndex="-1" mobile="false" data-click="false"></script><script id="canvas_nest" defer="defer" color="0,0,255" opacity="0.7" zIndex="-1" count="99" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-nest.min.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"log":false,"model":{"jsonPath":"/live2dw/assets/shizuku.model.json"},"display":{"position":"right","width":150,"height":300},"mobile":{"show":false},"react":{"opacity":0.7}});</script></body></html>