SHOW DATABASES; SHOW TABLES; DESC 表名; 或 DESCRIBE 表名;
原数据表的结构,索引
1
SHOW CREATE TABLE 表名;
修改表名
1
RENAME TABLE 原表名 to 新表名;
数据查询语言DQL(Data Query Language)——SELECT
简单查询
1 2
SELECT * FROM 表名 WHERE 字段='值'; SELECT * FROM 表名 WHERE 条件 IN('值','值',...,'值');
联表查询——左连接(LEFT JOIN)
1
SELECT a.*,b.字段(需要的值) FROM B表名 b LEFT JOIN A表名 a ON a.字段 =b.字段 WHERE 字段='值';
嵌套查询
1
SELECT * FROM A表名 WHERE 字段1 IN(SELECT 字段1 FROM B表名 WHERE 字段3 ='值');
去掉重复值——DISTINCT
1
SELECT DISTINCT 字段 FROM 表名;
限制行数——LIMIT
1
SELECT * FROM 表名 LIMIT 数值;
范围区间——BETWEEN…AND
1
SELECT * FROM 表名 WHERE 字段1 = '值' AND 字段2 BETWEEN '起始范围' AND '结束范围';
除…之外——NOT IN
1
SELECT 字段(需要的值) FROM 表名 WHERE 字段(除...之外) NOT IN ('值');
包含——LIKE
1
SELECT * FROM 表面 WHERE 字段 LIKE '%值%';
排序——升序(ASC)、降序(DESC)、先升序再升序、先降序再降序
1 2 3 4 5
SELECT * FROM 表名 WHERE 字段 = '值' ORDER BY 排序字段 ASC; SELECT * FROM 表名 WHERE 字段 = '值' ORDER BY 排序字段 DESC; SELECT * FROM 表名 WHERE 字段 = '值' ORDER BY 排序字段1 ASC,排序字段2 ASC; SELECT * FROM 表名 WHERE 字段 = '值' ORDER BY 排序字段1,排序字段2; # 默认升序 SELECT * FROM 表名 WHERE 字段 = '值' ORDER BY 排序字段1 DESC,排序字段2 DESC;
分组——GROUP BY
1 2 3
SELECT * FROM 表名 GROUP BY 字段1,...,字段N; SELECT * FROM 表名 GROUP BY 字段1,...,字段N ORDER BY 字段 ASC/DESC; SELECT * FROM 表名 GROUP BY 字段1,...,字段N HAVING 字段(<、>、=)值;
组合查询——UNION ALL
1
SELECT 字段 FROM 表名 WHERE 字段='值' UNION ALL SELECT 字段 FROM 表名 WHERE 字段='值';
设置别名——AS
1
SELECT 字段 AS 别名 FROM 表名;
WHERE过滤空值
1 2 3
WHERE 列名 IS NOT NULL WHERE 列名 != ‘NULL’ WHERE 列名 <> ‘NULL’
操作符
1 2
AND OR
值——最大值(MAX)、最小值(MIN)、平均值(AVG)、和(SUM)
1 2 3 4
SELECT MAX(字段) FROM 表名; SELECT MIN(字段) FROM 表名; SELECT AVG(字段) FROM 表名; SELECT SUM(字段) FROM 表名;
Zg Lao@admin MINGW64 ~/Desktop $ git -v git version 2.43.0.windows.1
出现版本号,就证明安装成功
四、Hexo
安装Hexo
打开终端管理员命令行页面,执行命令npm install -g hexo-cli,安装Hexo
1 2 3 4 5 6 7 8 9 10 11
PS C:\Users\20538> npm install -g hexo-cli
added 53 packages in 17s
14 packages are looking for funding run `npm fund` for details npm notice npm notice New minor version of npm available! 10.7.0 -> 10.8.1 npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.1 npm notice To update run: npm install -g npm@10.8.1 npm notice
PS C:\Users\20538> npm install -g hexo-cli npm error code ECONNRESET npm error syscall read npm error errno ECONNRESET npm error network request to https://registry.npmjs.org/hexo-fs failed, reason: read ECONNRESET npm error network This is a problem related to network connectivity. npm error network In most cases you are behind a proxy or have bad network settings. npm error network npm error network If you are behind a proxy, please make sure that the npm error network 'proxy' config is set properly. See: 'npm help config'
npm error A complete log of this run can be found in: C:\Users\20538\AppData\Local\npm-cache\_logs\2024-07-25T02_16_17_523Z-debug-0.log
查看当前配置的npm源
1 2
PS C:\Users\20538> npm config get registry https://registry.npmjs.org/
更换npm源
1 2 3
PS C:\Users\20538> npm config set registry https://registry.npm.taobao.org/ # 或者 PS C:\Users\20538> npm config set registry https://registry.npmmirror.com/
PS C:\Users\20538> cd D:\Blog PS D:\Blog> hexo init INFO Cloning hexo-starter https://github.com/hexojs/hexo-starter.git INFO Install dependencies INFO Start blogging with Hexo!
PS C:\Users\20538> ssh-keygen -t rsa -C "3878XX6714@qq.com" Generating public/private rsa key pair. Enter file in which to save the key (C:\Users\20538/.ssh/id_rsa): Created directory 'C:\\Users\\20538/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in C:\Users\20538/.ssh/id_rsa Your public key has been saved in C:\Users\20538/.ssh/id_rsa.pub The key fingerprint is: SHA256:MZ5Yd1Gt1iJJ5z3l4DEfN1patptTv4A8swcN2+1Y5v0 3878XX6714@qq.com The key's randomart image is: +---[RSA 3072]----+ | .... | | ..=*+| | + ...=*X*| | + = ooo*o*| | . S . *o..*| | B + B.| | = B +| | . o +.| | . E| +----[SHA256]-----+
打开终端(Win+R键,输入cmd)或者终端管理员命令行页面,执行命令ssh -T git@github.com,提示Are you sure you want to continue connecting (yes/no/[fingerprint])?(您确定要继续连接吗(是/否/[指纹])?)需要手动输入yes
1 2 3 4 5 6 7
PS C:\Users\20538> ssh -T git@github.com The authenticity of host 'github.com (20.205.243.166)' can't be established. ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU. This key is not known by any other names Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'github.com' (ED25519) to the list of known hosts. Hi Zglao! You've successfully authenticated, but GitHub does not provide shell access.
桌面右键打开Open Git Bash here终端命令行页面,进入D:\Blog路径,执行命令hexo clean && hexo g && hexo d
1 2 3 4 5 6 7 8 9 10 11 12 13
Zg Lao@admin MINGW64 ~/Desktop $ cd D:\Blog
Zg Lao@admin MINGW64 /d/Blog $ hexo clean && hexo g && hexo d INFO Validating config INFO Deleted database. INFO Deleted public folder. INFO Validating config INFO Start processing INFO Files loaded in 100 ms ... INFO Deploy done: git
桌面右键打开Open Git Bash here终端命令行页面,进入D:\Blog路径执行命令hexo new page about,会在路径D:\Blog\source下生成about文件夹以及about文件夹下文件index.md,在index.md文件中编辑内容,编辑完成后,在D:\Blog路径,执行命令hexo clean && hexo g && hexo d上传Github
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Zg Lao@admin MINGW64 ~/Desktop $ cd D:\Blog
Zg Lao@admin MINGW64 /d/Blog $ hexo new page about INFO Validating config INFO Created: D:\Blog\source\about\index.md
Zg Lao@admin MINGW64 /d/Blog $ hexo clean && hexo g && hexo d INFO Validating config INFO Deleted database. INFO Deleted public folder. INFO Validating config INFO Start processing INFO Files loaded in 176 ms ... INFO Deploy done: git
执行完成,打开浏览器输入Zglao.github.io进入个人博客查看About(关于)页面
Gallery(相册)
桌面右键打开Open Git Bash here终端命令行页面,进入D:\Blog路径执行命令hexo new page gallery,会在路径D:\Blog\source下生成gallery文件夹以及gallery文件夹下文件index.md,在index.md文件中编辑内容(手动在路径D:\Blog\source下创建文件夹存放相册中的图像,博主命名Gallery Images),编辑完成后,在D:\Blog路径,执行命令hexo clean && hexo g && hexo d上传Github
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Zg Lao@admin MINGW64 ~/Desktop $ cd D:\Blog
Zg Lao@admin MINGW64 /d/Blog $ hexo new page gallery INFO Validating config INFO Created: D:\Blog\source\gallery\index.md
Zg Lao@admin MINGW64 /d/Blog $ hexo clean && hexo g && hexo d INFO Validating config INFO Deleted database. INFO Deleted public folder. INFO Validating config INFO Start processing INFO Files loaded in 180 ms ... INFO Deploy done: git
桌面右键打开Open Git Bash here终端命令行页面,进入D:\Blog路径,执行命令hexo clean && hexo g && hexo d
1 2 3 4 5 6 7 8 9 10 11 12 13
Zg Lao@admin MINGW64 ~/Desktop $ cd D:\Blog
Zg Lao@admin MINGW64 /d/Blog $ hexo clean && hexo g && hexo d INFO Validating config INFO Deleted database. INFO Deleted public folder. INFO Validating config INFO Start processing INFO Files loaded in 191 ms ... INFO Deploy done: git
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Zg Lao@admin MINGW64 /d/Gitee (master) $ cd D:\Gitee\InstallPackage
Zg Lao@admin MINGW64 /d/Gitee/InstallPackage (master) $ git status On branch master Your branch is up to date with 'origin/master'.
Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) modified: README.en.md modified: README.md
Untracked files: (use "git add <file>..." to include in what will be committed) Git-2.43.0-64-bit.exe Node-v20.15.0-x64.msi Typora/
no changes added to commit (use "git add" and/or "git commit -a")
Zg Lao@admin MINGW64 /d/Gitee/InstallPackage (master) $ git status On branch master Your branch is up to date with 'origin/master'.
Changes to be committed: (use "git restore --staged <file>..." to unstage) new file: Git-2.43.0-64-bit.exe new file: Node-v20.15.0-x64.msi modified: README.en.md modified: README.md new file: Typora/typora-setup-x64-1.6.7.exe new file: Typora/winmm.dll
提交的内容添加注释说明
添加注释说明格式git commit -m '说明'(说明一般是添加文件或者修改文件或者删除文件的说明),执行命令git commit -m "Add files(node git Typora) from InstallPackage and modify files(README.md README.en.md)和git status
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Zg Lao@admin MINGW64 /d/Gitee/InstallPackage (master) $ git commit -m "Add files(node git Typora) from InstallPackage and modify files(README.md README.en.md)" [master a629253] Add files(node git Typora) from InstallPackage and modify files(README.md README.en.md) 6 files changed, 12 insertions(+), 54 deletions(-) create mode 100644 Git-2.43.0-64-bit.exe create mode 100644 Node-v20.15.0-x64.msi create mode 100644 Typora/typora-setup-x64-1.6.7.exe create mode 100644 Typora/winmm.dll Zg Lao@admin MINGW64 /d/Gitee/InstallPackage (master) $ git status On branch master Your branch is ahead of 'origin/master' by 1 commit. (use "git push" to publish your local commits)
nothing to commit, working tree clean
上传Gitee
执行命令git push,上传本地仓库至Gitee仓库
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Zg Lao@admin MINGW64 /d/Gitee/InstallPackage (master) $ git push Enumerating objects: 12, done. Counting objects: 100% (12/12), done. Delta compression using up to 8 threads Compressing objects: 100% (9/9), done. Writing objects: 100% (9/9), 161.70 MiB | 3.37 MiB/s, done. Total 9 (delta 0), reused 0 (delta 0), pack-reused 0 remote: Powered by GITEE.COM [GNK-6.4] remote: warning: This repository has 2 files larger than 50.00 MB remote: The size information of several files as follows: remote: File 6e49f7ddfaddb755fb24fcc16b1ca15f13b8751f 57.60 MB remote: File 9fb4faddf5e36bb8831a929bbd726823abc57a53 79.09 MB remote: Use command below to see the filename: remote: git rev-list --objects --all | grep $oid remote: HelpLink: https://gitee.com/help/articles/4232 To https://gitee.com/zglao/InstallPackage.git 0c63870..a629253 master -> master