This commit is contained in:
YUN-PC5\user 2023-10-07 17:10:46 +08:00
parent c290e2627a
commit 728d62d6ab
5 changed files with 178 additions and 8 deletions

View File

@ -45,3 +45,114 @@ mysqldump -uroot -p test --no-data > test.sql
mysqldump -uroot -p -B test > test.sql mysqldump -uroot -p -B test > test.sql
``` ```
## Windows 下安装 绿色版
先下载[MySQL :: Download MySQL Community Server](https://dev.mysql.com/downloads/mysql/)
![image-20231007124717167](https://markdownhexo.oss-cn-hangzhou.aliyuncs.com/img/image-20231007124717167.png)
1. 解压下载好的压缩包
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210120105901505.png#pic_left)
2. 解压后得到
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210120105247435.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0NXZVFpbg==,size_16,color_FFFFFF,t_70#pic_center)
3. 新建一个 `my.ini`文件
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210120110525427.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0NXZVFpbg==,size_16,color_FFFFFF,t_70#pic_center)
4. 解压后的mysql根目录下没有my.ini文件自己去网上找一份就可或者使用我在后面给出的代码。.ini文件会在初始化mysql中用到
```ini
# For advice on how to change settings please see
# http=//dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[client]
port = 3306
default-character-set = utf8
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option= logging
# changes to the binary log between backups.
# log_bin
port = 3306
# These are commonly set, remove the # and set as required.
basedir="D:\app\mysql-5.7.43-winx64"
datadir="D:\app\mysql-5.7.43-winx64\data"
# server_id = .....
character_set_server = utf8
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
```
5. 修改ini配置文件中的安装目录和数据存放目录修改为mysql文件的路径
6. \#设置mysql的安装目录
basedir=D:\app\mysql-5.7.43-winx64
\#设置mysql数据库的数据的存放目录
datadir=D:\app\mysql-5.7.43-winx64\data
7. 打开cmd初始化数据库
```powershell
mysqld --initialize
```
8. 初始化完成后mysqld根目录下会自动新增data文件夹
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210120153744844.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0NXZVFpbg==,size_16,color_FFFFFF,t_70#pic_center)
9. 打开data文件夹找到.err后缀文本打开
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210120153933128.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0NXZVFpbg==,size_16,color_FFFFFF,t_70#pic_center)
10. 找到文件password位置红色框中为数据库初始化密码后续修改初始化密码使用
```err
2023-10-07T04:37:02.330654Z 1 [Note] A temporary password is generated for root@localhost: (iw?Mw:Vs7n&
```
11. 安装数据库
```powershell
mysqld --install
```
12. 启动服务
```powershell
net start mysql
```
13. 关闭服务
```powershell
net stop mysql
```
14. 修改初始密码
- 登录
```powershell
mysql -uroot -p'你的初始密码步骤4中红框里的字符'
```
- 修改密码为 123456
```mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
```
15. 服务卸载
```powershell
net stop mysql
mysqld --remove
```

View File

@ -91,13 +91,18 @@ http {
gzip_disable "MSIE [1-6]\."; #配置禁用gzip条件支持正则。此处表示ie6及以下不启用gzip因为ie低版本不支持 gzip_disable "MSIE [1-6]\."; #配置禁用gzip条件支持正则。此处表示ie6及以下不启用gzip因为ie低版本不支持
# 是否在http header中添加Vary: Accept-Encoding建议开启 # 是否在http header中添加Vary: Accept-Encoding建议开启
gzip_vary on; gzip_vary on;
# map $http_upgrade $connection_upgrade { # map $http_upgrade $connection_upgrade {
# 如果$http_upgrade的值与default不匹配通常是指$http_upgrade未设置或未匹配任何其他条件则将$connection_upgrade设置为upgrade。
# default upgrade; # default upgrade;
# 如果$http_upgrade的值为空字符串''),则将$connection_upgrade设置为close。这意味着Nginx将关闭连接而不是升级。
# '' close; # '' close;
# } # }
map $http_connection $connection_upgrade { map $http_connection $connection_upgrade {
# 如果$http_connection的值匹配正则表达式~*Upgrade不区分大小写地匹配包含"Upgrade"的值),则将$connection_upgrade设置为$http_connection的值通常是upgrade。
"~*Upgrade" $http_connection; "~*Upgrade" $http_connection;
# 如果没有匹配的值,将$connection_upgrade设置为keep-alive。这意味着Nginx将保持HTTP连接保持活动状态以进行进一步的请求和响应。
default keep-alive; default keep-alive;
} }
server { server {
@ -182,7 +187,6 @@ http {
location /msghub { location /msghub {
proxy_pass http://127.0.0.1:50/msgHub; proxy_pass http://127.0.0.1:50/msgHub;
# Configuration for WebSockets
# 配置 Upgrade 头字段,用于支持 WebSocket 协议升级。当客户端请求 WebSocket 协议时Nginx 会传递 Upgrade 头字段给后端服务器以升级连接协议。 # 配置 Upgrade 头字段,用于支持 WebSocket 协议升级。当客户端请求 WebSocket 协议时Nginx 会传递 Upgrade 头字段给后端服务器以升级连接协议。
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
# 配置 Connection 头字段,用于支持 WebSocket 连接的升级。当客户端请求 WebSocket 协议时Nginx 会传递 Connection 头字段给后端服务器以升级连接协议。 # 配置 Connection 头字段,用于支持 WebSocket 连接的升级。当客户端请求 WebSocket 协议时Nginx 会传递 Connection 头字段给后端服务器以升级连接协议。
@ -190,14 +194,11 @@ http {
# 禁用了代理缓存,这意味着 Nginx 不会缓存代理响应,适用于实时通信场景,如 WebSocket。 # 禁用了代理缓存,这意味着 Nginx 不会缓存代理响应,适用于实时通信场景,如 WebSocket。
proxy_cache off; proxy_cache off;
# 配置了 HTTP 协议版本为 1.1,这是为了支持 WebSocket因为 WebSocket 是在 HTTP/1.1 之后的协议中实现的。 # 配置了 HTTP 协议版本为 1.1,这是为了支持 WebSocket因为 WebSocket 是在 HTTP/1.1 之后的协议中实现的。
# WebSockets were implemented after http/1.0
proxy_http_version 1.1; proxy_http_version 1.1;
# Configuration for ServerSentEvents
# 禁用了代理的缓冲功能,这适用于实时通信场景,如 WebSocket 或 Server-Sent EventsSSE以确保数据立即传递给客户端而不进行缓冲。 # 禁用了代理的缓冲功能,这适用于实时通信场景,如 WebSocket 或 Server-Sent EventsSSE以确保数据立即传递给客户端而不进行缓冲。
proxy_buffering off; proxy_buffering off;
# Configuration for LongPolling or if your KeepAliveInterval is longer than 60 seconds
# 配置了代理的读取超时时间为 100 秒,这允许长轮询或者当 Keep-Alive 间隔大于 60 秒时的请求保持连接。 # 配置了代理的读取超时时间为 100 秒,这允许长轮询或者当 Keep-Alive 间隔大于 60 秒时的请求保持连接。
proxy_read_timeout 100s; proxy_read_timeout 100s;

View File

@ -0,0 +1,29 @@
---
title: PowerShell
date: 2023-10-07 11:25:08
tags:
---
# 文件
## 新建文件
```powershell
New-Item <文件名>.<扩展名后缀>
New-Item my.ini
```
## 删除文件
```powershell
Remove-Item <文件名>.<扩展名后缀>
Remove-Item my.ini
```
## 对文件添加内容
```powershell
Set-Content <文件名>.<扩展名后缀> -value "<内容>"
Set-Content my.ini -value ""
```

View File

@ -35,14 +35,21 @@ make install PREFIX=/usr/redis
到redis安装文件夹 到redis安装文件夹
修改监听端口
```conf
bind 127.0.0.1 6379
```
修改库的个数
```shell ```shell
# Set the number of databases. The default database is DB 0, you can select # Set the number of databases. The default database is DB 0, you can select
# a different one on a per-connection basis using SELECT <dbid> where # a different one on a per-connection basis using SELECT <dbid> where
# dbid is a number between 0 and 'databases'-1 # dbid is a number between 0 and 'databases'-1
databases 16 databases 16
``` ```
修改端口号port
修改库的的个数
```shell ```shell
# Accept connections on the specified port, default is 6379 (IANA #815344). # Accept connections on the specified port, default is 6379 (IANA #815344).
@ -50,7 +57,11 @@ databases 16
port 6379 port 6379
``` ```
修改端口号port 设置密码
```conf
requirepass yourpassword
```
# Redis指令 # Redis指令

View File

@ -1861,6 +1861,24 @@ yarn
| npm install [package]@[version] | yarn add [package]@[version] | 安装指定版本的包 | | npm install [package]@[version] | yarn add [package]@[version] | 安装指定版本的包 |
| npm rebuild | yarn install --force | 重新下载所有包 | | npm rebuild | yarn install --force | 重新下载所有包 |
## 快速删除 node_modules
利用 npm 包 rimraf 快速删除 `node_modules` 文件夹
先全局安装 npm 包
```shell
npm install rimraf -g
```
使用
```shell
rimraf node_modules
```
# npx # npx
npm大家都知道是node的包管理器npx虽然也见过但似乎较少用过那npx到底是什么呢 npm大家都知道是node的包管理器npx虽然也见过但似乎较少用过那npx到底是什么呢