u
No files matched your search
@@ -1 +0,0 @@
|
||||
1
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"label": "编程",
|
||||
"position": 3,
|
||||
"link": {
|
||||
"type": "generated-index"
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
出现白屏参考上面的方案。
|
||||
|
||||
使用的是 Vscode 模板的话,直接参考 [vue3\_低版本浏览器适配.md](..\vue\vue3\vue3_低版本浏览器适配.md)
|
||||
使用的是 Vscode 模板的话,直接参考
|
||||
|
||||
使用的是 Hbuilderx 模板的话,在根目录下添加`vite.config.js`文件
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
SQL Server 是微软推出的一款关系型数据库管理系统(RDBMS),主要用于存储、管理和处理结构化数据。
|
||||
|
||||
简单来说可以这样理解:
|
||||
|
||||
稳定可靠:常用于企业级应用,适合处理大量数据和高并发场景
|
||||
|
||||
功能全面:支持事务、索引、视图、存储过程、触发器等常见数据库功能
|
||||
|
||||
和微软生态集成好:和 Windows、.NET、Azure 等配合非常顺畅
|
||||
|
||||
易上手:自带管理工具(SSMS),对新手和运维都比较友好
|
||||
@@ -0,0 +1,200 @@
|
||||
## Windows系统
|
||||
|
||||
### 安装
|
||||
|
||||
**1**、登陆微软中国官网:[Microsoft - Official Home Page](https://link.zhihu.com/?target=https%3A//www.microsoft.com/zh-cn/);在搜索中输入 SQL Server 2008 并搜索。
|
||||
|
||||

|
||||
|
||||
下载链接:
|
||||
|
||||
[Download Microsoft® SQL Server® 2008 R2 SP2 - Express Edition from Official Microsoft Download Center](https://link.zhihu.com/?target=https%3A//www.microsoft.com/zh-CN/download/details.aspx%3Fid%3D30438)
|
||||
|
||||
**2**、下载
|
||||
|
||||
下载 64 位程序,如果系统是 32 位,就选 32 位的
|
||||
|
||||

|
||||
|
||||
这里只下载 **SQLEXPR_x64_CHS.exe** ,可视化工具选用 **Navicat**
|
||||
|
||||
**3**、安装
|
||||
|
||||
先安装SQL,再安装 SQL Management Studio
|
||||
|
||||
双击SQLEXPR_x64.CHS
|
||||
|
||||

|
||||
|
||||
等待加载完毕
|
||||
|
||||
(这时会有一定的几率提醒你的电脑缺少[Microsoft .NET Framework 2.0](https://zhida.zhihu.com/search?content_id=102713512&content_type=Article&match_order=1&q=Microsoft+.NET+Framework+2.0&zd_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ6aGlkYV9zZXJ2ZXIiLCJleHAiOjE3NDk3MzMwMzQsInEiOiJNaWNyb3NvZnQgLk5FVCBGcmFtZXdvcmsgMi4wIiwiemhpZGFfc291cmNlIjoiZW50aXR5IiwiY29udGVudF9pZCI6MTAyNzEzNTEyLCJjb250ZW50X3R5cGUiOiJBcnRpY2xlIiwibWF0Y2hfb3JkZXIiOjEsInpkX3Rva2VuIjpudWxsfQ.riy6QZKx3etA1Hd2g0oaCLoNl0G_pzuoq8tZqWZXfFo&zhida_source=entity) 或更高版本
|
||||
|
||||
根据他的提示进行安装就行)
|
||||
|
||||

|
||||
|
||||
如果没有,请忽略这一步。
|
||||
|
||||
当他顺利加载完毕之后,我们就可以看到下图所示的界面,**点击全新安装**
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
接受并下一步
|
||||
|
||||

|
||||
|
||||
点击安装
|
||||
|
||||
一直下一步,保持默认设置到”实例配置“这一节,并选择”默认实例“,并点击下一步
|
||||
|
||||

|
||||
|
||||
再一路下一步到”数据库引擎配置这一节“
|
||||
|
||||

|
||||
|
||||
如果没有用户的话就点击”添加当前用户”
|
||||
|
||||

|
||||
|
||||
错误报告可选可不选
|
||||
|
||||
一直下一步直到安装完成
|
||||
|
||||

|
||||
|
||||
到此为止,我们的安装过程已经进行完成了。 SQL Management Studio 可按照需求安装
|
||||
|
||||
### 配置
|
||||
|
||||
#### 服务
|
||||
|
||||
Windows 系统:`win` + `r` 输入 `services.msc` ,打开后找到 SqlServer 相关的,并将服务修改为自动,并且需要 首次 手动启动
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
#### 协议
|
||||
|
||||
`win` 键启动搜索,搜索 SQL Server 配置管理器
|
||||
|
||||

|
||||
|
||||
点击 SQL Server 配置管理器,确保该三个协议已启动,未启动则启动
|
||||
|
||||
#### 端口
|
||||
|
||||
右键 TCP/IP
|
||||
|
||||

|
||||
|
||||
点击属性,修改 TCP 端口 为 1433
|
||||
|
||||

|
||||
|
||||
点击 应用 和 确认后,**重启电脑才能生效**
|
||||
|
||||
### 校验
|
||||
|
||||
**校验是否安装正确**
|
||||
|
||||
打开 **命令提示符**(Win + R,输入 `cmd`,回车)
|
||||
|
||||
Windows 上默认安装 SQL Server 的时候,通常会带有 `sqlcmd` 工具(如果没有,可能需要单独安装“命令行工具”)。
|
||||
|
||||
1. 打开 **命令提示符**(Win + R,输入 `cmd`,回车)
|
||||
2. 输入以下命令连接本机默认实例:
|
||||
|
||||
```bash
|
||||
sqlcmd -S localhost -E
|
||||
```
|
||||
|
||||
参数说明:
|
||||
|
||||
- `-S localhost` :连接本机默认实例
|
||||
- `-E` :使用 Windows 身份验证
|
||||
|
||||
3. 如果成功连接,你会看到类似如下提示:
|
||||
|
||||
```shell
|
||||
1>
|
||||
```
|
||||
|
||||
4. 在提示符后输入测试命令:
|
||||
|
||||
```sql
|
||||
SELECT @@VERSION;
|
||||
GO
|
||||
```
|
||||
|
||||
然后按回车,输出当前 SQL Server 版本信息,证明连接成功。
|
||||
|
||||
5. 输入
|
||||
|
||||
```
|
||||
QUIT
|
||||
```
|
||||
|
||||
退出命令行界面。
|
||||
|
||||
### 启用混合模式认证(SQL Server 和 Windows 认证)
|
||||
|
||||
默认情况下,SQL Server 只开启 Windows 认证(Windows Authentication Mode),你需要手动开启“混合模式”(Mixed Mode Authentication),才能使用 SQL Server 账号(如 `sa`)登录。
|
||||
|
||||
1. 打开命令提示符,连接到 SQL Server:
|
||||
|
||||
```bash
|
||||
sqlcmd -S localhost -E
|
||||
```
|
||||
|
||||
2. 执行以下命令开启混合模式:
|
||||
|
||||
```sql
|
||||
EXEC xp_instance_regwrite
|
||||
N'HKEY_LOCAL_MACHINE',
|
||||
N'Software\Microsoft\MSSQLServer\MSSQLServer',
|
||||
N'LoginMode',
|
||||
REG_DWORD,
|
||||
2
|
||||
GO
|
||||
```
|
||||
|
||||
> 说明:`LoginMode` 设置为 `2` 表示混合模式,`1` 表示只 Windows 认证。
|
||||
|
||||
3. 重启 SQL Server 服务,使设置生效:
|
||||
|
||||
- 打开服务管理器,找到 `SQL Server (实例名)` 服务,点击“重启”或先停止再启动。
|
||||
|
||||
4. 启用 `sa` 账号并设置密码(默认可能禁用)
|
||||
|
||||
继续用 `sqlcmd` 执行:
|
||||
|
||||
```
|
||||
ALTER LOGIN sa ENABLE;
|
||||
GO
|
||||
ALTER LOGIN sa WITH PASSWORD = '你的强密码';
|
||||
GO
|
||||
```
|
||||
|
||||
- **密码建议**:至少 8 位,包含大小写字母、数字和特殊符号。
|
||||
|
||||
5. 测试账号密码登录
|
||||
|
||||
- 使用 `sqlcmd`:
|
||||
|
||||
```bash
|
||||
sqlcmd -S localhost -U sa -P 你的密码
|
||||
```
|
||||
|
||||
- 连接成功即开启账号密码登录。
|
||||
|
||||
6. 额外说明
|
||||
|
||||
- 修改注册表和重启服务后才生效。
|
||||
- 也可以用 PowerShell 或其他管理工具执行上述 SQL 命令。
|
||||
- 强烈建议启用强密码,防止安全风险。
|
||||
- 生产环境尽量避免启用 `sa`,建议创建新的 SQL 登录账号。
|
||||
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 135 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 125 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 142 KiB |
|
After Width: | Height: | Size: 156 KiB |
|
After Width: | Height: | Size: 151 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 173 KiB |
|
After Width: | Height: | Size: 168 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 83 KiB |
@@ -57,6 +57,7 @@ pnpm swizzle @docusaurus/theme-classic BlogPostPage
|
||||
- 这时你的项目目录下src/theme/BlogPostPage生成了自定义主题的文件
|
||||
|
||||
添加依赖
|
||||
|
||||
```bash
|
||||
pnpm add @docusaurus/theme-common @docusaurus/plugin-content-blog
|
||||
```
|
||||
@@ -161,6 +162,7 @@ export default function BlogPostPage(props) {
|
||||
```
|
||||
|
||||
### 3.2 开启文档评论
|
||||
|
||||
```bash
|
||||
pnpm swizzle @docusaurus/theme-classic DocItem/Layout
|
||||
```
|
||||
@@ -170,6 +172,7 @@ pnpm swizzle @docusaurus/theme-classic DocItem/Layout
|
||||
- 这时你的项目目录下src/theme/BlogPostPage生成了自定义主题的文件
|
||||
|
||||
添加依赖
|
||||
|
||||
```bash
|
||||
pnpm add @docusaurus/plugin-content-docs
|
||||
```
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
Git:https://git-scm.com/
|
||||
|
||||
Git 是一个免费、开源的分布式版本控制系统,旨在以高效、快速的方式处理从小型到超大型的各种项目。
|
||||
|
||||
Git 的速度非常快,并且拥有庞大的生态系统,包括各种图形界面(GUI)、代码托管服务以及命令行工具。
|
||||
@@ -0,0 +1,32 @@
|
||||
## 概念
|
||||

|
||||
|
||||
Git 管理代码时,一般会经过这四个地方:
|
||||
- 工作区:放置代码的 目录/文件夹
|
||||
- 暂存区:就是相当于一个临时地方,将代码先放到这里
|
||||
- 本地仓库:电脑的正是仓库,就是相当于将代码正式放到了自己电脑的仓库中,保存代码的历史记录
|
||||
- 远程仓库:网络/云 上的仓库,方便和别人进行协作
|
||||
|
||||
可根据上面的图进行理解
|
||||
|
||||
## 基础操作
|
||||
```bash
|
||||
// 一般只有初始化仓库的时候才会用到
|
||||
git init
|
||||
|
||||
// 1.克隆远程仓库的代码
|
||||
git clone [url]
|
||||
|
||||
// 2.提交自己修改过的代码
|
||||
git add .
|
||||
git commit -m "注释"
|
||||
|
||||
// 3.拉取远程仓库的最新代码
|
||||
git pull
|
||||
|
||||
// 4.将自己的修改推送到远程仓库
|
||||
git push origin master
|
||||
```
|
||||
|
||||
## 命令速查表
|
||||

|
||||
@@ -0,0 +1,193 @@
|
||||
## push之前未pull
|
||||
|
||||
报错信息:
|
||||
|
||||
```bash
|
||||
D:\code\test\test1>git push origin master
|
||||
To http://192.168.1.189:8443/r/test.git
|
||||
! [rejected] master -> master (fetch first)
|
||||
error: failed to push some refs to 'http://192.168.1.189:8443/r/test.git'
|
||||
hint: Updates were rejected because the remote contains work that you do not
|
||||
hint: have locally. This is usually caused by another repository pushing to
|
||||
hint: the same ref. If you want to integrate the remote changes, use
|
||||
hint: 'git pull' before pushing again.
|
||||
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
|
||||
```
|
||||
|
||||
解决方法:
|
||||
|
||||
```bash
|
||||
# 先拉取
|
||||
git pull
|
||||
# 后推送
|
||||
git push origin master
|
||||
```
|
||||
|
||||
**注意:** 不要强推,可能覆盖他人修改,一般用不到。
|
||||
|
||||
```bash
|
||||
git push -f origin master
|
||||
```
|
||||
|
||||
## 合并冲突(修改同一文件)
|
||||
当 A 和 B 同时修改了同一文件的时候,本地文件和远程文件发生了冲突。Git 无法自动合并,需要你手动解决冲突。
|
||||
|
||||
例如:
|
||||
|
||||
```bash
|
||||
CONFLICT (content): Merge conflict in a.txt
|
||||
Automatic merge failed; fix conflicts and then commit the result.
|
||||
```
|
||||
|
||||
意思是:
|
||||
|
||||
- Git 在合并文件 `a.txt` 时,发现本地和远程对同一部分代码进行了修改;
|
||||
- 无法判断以哪一方为准,自动合并失败;
|
||||
- 需要你手动处理这个冲突。
|
||||
|
||||
解决方案:
|
||||
|
||||
1. 打开冲突的 `a.txt` 文件,查看里面的内容:
|
||||
|
||||
```
|
||||
<<<<<<< HEAD
|
||||
12 # 这里是 A 修改的
|
||||
=======
|
||||
1 # 这里是 B 修改的
|
||||
2
|
||||
>>>>>>> 6fe1e2d97eae79e0c5080ddea4bdef658841486d
|
||||
```
|
||||
|
||||
2. 手动修改内容,保留需要的部分。例如:
|
||||
|
||||
```
|
||||
12
|
||||
```
|
||||
|
||||
3. 添加修改后的文件:
|
||||
|
||||
```bash
|
||||
git add a.txt
|
||||
|
||||
git commit -m "解决 a.txt 冲突"
|
||||
|
||||
git push origin master
|
||||
```
|
||||
|
||||
## 修改文件但 git status 显示未修改
|
||||
|
||||
可能的原因:
|
||||
|
||||
- 你改的是换行符(LF/CRLF)但内容没变;
|
||||
- 编辑器保存规则设置导致未检测到真实修改;
|
||||
- 文件编码问题或隐藏字符。
|
||||
|
||||
解决方法:
|
||||
|
||||
- 用 `git diff` 检查是否真的修改了;
|
||||
- 也可以尝试先改点内容,再恢复,重新保存。
|
||||
|
||||
## 误删文件
|
||||
### 文件误删并已 add
|
||||
误删了一个文件(比如 `b.txt`),然后执行了:
|
||||
|
||||
```bash
|
||||
git add a.txt
|
||||
```
|
||||
|
||||
- 这时候 Git **把删除操作加入暂存区**,等待 commit。
|
||||
- 文件还没有被 commit,但已经从工作区和暂存区记录为“删除”。
|
||||
|
||||
|
||||
|
||||
**查看哪些文件被误删**
|
||||
|
||||
```bash
|
||||
git status
|
||||
```
|
||||
|
||||
示例输出
|
||||
|
||||
```bash
|
||||
Changes to be committed:
|
||||
(use "git restore --staged <file>..." to unstage)
|
||||
new file: a.txt
|
||||
|
||||
Changes not staged for commit:
|
||||
(use "git add/rm <file>..." to update what will be committed)
|
||||
(use "git restore <file>..." to discard changes in working directory)
|
||||
deleted: a.txt
|
||||
```
|
||||
|
||||
|
||||
|
||||
**恢复文件**
|
||||
|
||||
这会把文件从暂存区移除,但 **不会恢复工作区文件**。
|
||||
|
||||
```bash
|
||||
git restore --staged a.txt
|
||||
```
|
||||
|
||||
这会把文件从最后一次 commit 的版本恢复到工作区。
|
||||
|
||||
```bash
|
||||
git restore a.txt
|
||||
```
|
||||
|
||||
或者可以循环恢复多个误删文件:
|
||||
|
||||
```
|
||||
git restore --staged .
|
||||
git restore .
|
||||
```
|
||||
|
||||
> `git restore .` 会把所有误删且未 commit 的文件恢复。
|
||||
|
||||
### 文件已 commit,误删未 add
|
||||
|
||||
场景说明
|
||||
|
||||
- 文件 **已经被 Git commit**(也就是之前已经被保存到版本历史中)
|
||||
- 你在工作区 **误删了该文件**
|
||||
- **还没有执行 `git add`**
|
||||
|
||||
> 这时候 Git 知道文件原本存在,但工作区已经缺失。
|
||||
|
||||
|
||||
|
||||
**查看被误删的文件**
|
||||
|
||||
```bash
|
||||
git status
|
||||
```
|
||||
|
||||
示例输出:
|
||||
|
||||
```bash
|
||||
Changes not staged for commit:
|
||||
(use "git add/rm <file>..." to update what will be committed)
|
||||
deleted: a.txt
|
||||
```
|
||||
|
||||
> 🔹 `deleted: a.txt` 就是被误删的文件。
|
||||
|
||||
**恢复误删文件(未 add)**
|
||||
|
||||
```bash
|
||||
git restore a.txt
|
||||
```
|
||||
|
||||
> 这会从 **最近一次 commit** 恢复文件到工作区。
|
||||
|
||||
|
||||
|
||||
**检查文件是否恢复成功**
|
||||
|
||||
```
|
||||
git status
|
||||
```
|
||||
|
||||
- 文件会出现在工作区
|
||||
- `git status` 不再显示 `deleted`
|
||||
|
||||
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 945 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 828 KiB |
@@ -86,11 +86,6 @@ const config: Config = {
|
||||
label: '编程语言',
|
||||
position: 'left',
|
||||
items: [
|
||||
{
|
||||
type: 'docSidebar',
|
||||
label: 'Java',
|
||||
sidebarId: 'JavaSidebar',
|
||||
},
|
||||
{
|
||||
type: 'docSidebar',
|
||||
label: 'ReactNative',
|
||||
@@ -150,6 +145,11 @@ const config: Config = {
|
||||
label: 'PostgreSQL',
|
||||
sidebarId: 'PostgreSQLSidebar',
|
||||
},
|
||||
{
|
||||
type: 'docSidebar',
|
||||
label: 'SqlServer',
|
||||
sidebarId: 'SqlServerSidebar',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -199,6 +199,10 @@ const config: Config = {
|
||||
apiKey: 'b64300feec6e0441a508d8560efc4a03',
|
||||
indexName: 'docusaurus_docs',
|
||||
},
|
||||
tableOfContents: {
|
||||
minHeadingLevel: 2,
|
||||
maxHeadingLevel: 5,
|
||||
},
|
||||
} satisfies Preset.ThemeConfig,
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { SidebarsConfig } from '@docusaurus/plugin-content-docs'
|
||||
|
||||
const sidebars: SidebarsConfig = {
|
||||
// coding
|
||||
JavaSidebar: [{ type: 'autogenerated', dirName: 'coding/java' }],
|
||||
ReactNativeSidebar: [{ type: 'autogenerated', dirName: 'coding/react-native' }],
|
||||
UniappSidebar: [{ type: 'autogenerated', dirName: 'coding/uniapp' }],
|
||||
VueSidebar: [{ type: 'autogenerated', dirName: 'coding/vue' }],
|
||||
@@ -15,7 +14,7 @@ const sidebars: SidebarsConfig = {
|
||||
ServerSidebar: [{ type: 'autogenerated', dirName: 'dev-tools/server' }],
|
||||
// database
|
||||
PostgreSQLSidebar: [{ type: 'autogenerated', dirName: 'database/postgresql' }],
|
||||
|
||||
SqlServerSidebar: [{ type: 'autogenerated', dirName: 'database/sqlserver' }],
|
||||
}
|
||||
|
||||
export default sidebars
|
||||