提交
This commit is contained in:
parent
f484e52275
commit
85aa55b3a1
@ -22,7 +22,7 @@
|
||||
"hexo-generator-json-content": "^4.2.3",
|
||||
"hexo-generator-tag": "^2.0.0",
|
||||
"hexo-renderer-ejs": "^2.0.0",
|
||||
"hexo-renderer-marked": "^6.0.0",
|
||||
"hexo-renderer-marked": "^6.1.1",
|
||||
"hexo-renderer-pug": "^3.0.0",
|
||||
"hexo-renderer-stylus": "^2.1.0",
|
||||
"hexo-server": "^3.0.0",
|
||||
|
||||
@ -197,6 +197,20 @@ docker rmi -f $(docker images | grep "none" | awk '{print $3}')
|
||||
|
||||
来历:在docker反复build一个Dockerfile,并且使用相同tag(或者不用tag)会存留很多none镜像。第一次build生成一个image id, 再次build后,会重新生成一个image id, 命名和上一个一样,所以上一个镜像的tag和名字就会自动变成 `<none>`。
|
||||
|
||||
## 实时查看日志
|
||||
|
||||
```shell
|
||||
docker logs -f <CONTAINER ID>
|
||||
```
|
||||
|
||||
## 解决Linux 下普通用户执行docker命令权限问题
|
||||
|
||||
```shell
|
||||
sudo groupadd docker #添加用户组
|
||||
sudo gpasswd -a username docker #将当前用户添加至用户组
|
||||
newgrp docker #更新用户组
|
||||
```
|
||||
|
||||
## Docker Dockerfile
|
||||
|
||||
### 什么是 Dockerfile?
|
||||
@ -326,7 +340,11 @@ COPY hom?.txt /mydir/
|
||||
|
||||
**<目标路径>**:容器内的指定路径,该路径不用事先建好,路径不存在的话,会自动创建。
|
||||
|
||||
#### ADD
|
||||
|
||||
ADD 指令和 COPY 的使用格类似(同样需求下,官方推荐使用 COPY)。功能也类似,不同之处如下:
|
||||
|
||||
- ADD 的优点
|
||||
|
||||
# Docker 实例
|
||||
|
||||
@ -540,3 +558,19 @@ docker run --restart=always \
|
||||
-d redis:7.0.13 redis-server /etc/redis/redis.conf
|
||||
```
|
||||
|
||||
## Docker 安装 SeaweedFS
|
||||
|
||||
```shell
|
||||
docker run -itd -p 9333:9333 -p 19333:19333 -v /opt/seaweed/mdir:/data --name weed_master chrislusf/seaweedfs master -defaultReplication=001
|
||||
|
||||
docker run -itd -p 9334:8080 -v /opt/seaweed/vdir1:/data --name weed_volume1 --link weed_master chrislusf/seaweedfs volume -max=30 -mserver="weed_master:9333" -port=8080 -dataCenter=dc1 -rack=rack1
|
||||
|
||||
docker run -itd -p 9335:8080 -v /opt/seaweed/vdir2:/data --name weed_volume2 --link weed_master chrislusf/seaweedfs volume -max=30 -mserver="weed_master:9333" -port=8080 -dataCenter=dc1 -rack=rack1
|
||||
|
||||
curl -X PUT -F file=@/home/back.png http://volume1.tonisf.com:88/4,01eea6857d
|
||||
|
||||
docker run -itd -p 18080:8080 -p 8333:8333 -p 18888:8888 -p 9333:9333 -p 19333:19333 -v /opt/seaweed/mdir:/data --name weed_server chrislusf/seaweedfs server filter -defaultReplication=001 -s3
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
@ -253,6 +253,54 @@ unzip master.zip
|
||||
mv screenFetch-master/screenfetch-dev /usr/bin/screenfetch
|
||||
```
|
||||
|
||||
## wget 下载工具
|
||||
|
||||
#### 格式
|
||||
|
||||
wget [参数] [URL地址]
|
||||
|
||||
wget -O 图片名.png https://www.baidu.com/img/bd_logo1.png
|
||||
|
||||
#### 记录和输入文件参数
|
||||
|
||||
| 短格式 | 长格式 | 说明 |
|
||||
| ------ | ------------------- | ---------------------------------------------------- |
|
||||
| -o | –output-file=FILE | 把记录写到FILE文件中 |
|
||||
| -a | –append-output=FILE | 把记录追加到FILE文件中 |
|
||||
| -d | –debug | 打印调试输出 |
|
||||
| -q | –quiet | 安静模式(没有输出) |
|
||||
| -v | –verbose | 冗长模式(这是缺省设置) |
|
||||
| -nv | –non-verbose | 关掉冗长模式,但不是安静模式 |
|
||||
| -i | –input-file=FILE | 下载在FILE文件中出现的URLs |
|
||||
| -F | –force-html | 把输入文件当作HTML格式文件对待 |
|
||||
| -B | –base=URL | 将URL作为在-F -i参数指定的文件中出现的相对链接的前缀 |
|
||||
| | –sslcertfile=FILE | 可选客户端证书 |
|
||||
| | –sslcertkey=KEYFILE | 可选客户端证书的KEYFILE |
|
||||
| | –egd-file=FILE | 指定EGD socket的文件名 |
|
||||
|
||||
#### 下载参数
|
||||
|
||||
| 短格式 | 长格式 | 说明 |
|
||||
| ------ | --------------------- | -------------------------------------------------------- |
|
||||
| | –bind-address=ADDRESS | 指定本地使用地址(主机名或IP,当本地有多个IP或名字时使用) |
|
||||
| -t | –tries=NUMBER | 设定最大尝试链接次数(0 表示无限制). |
|
||||
| -O | –output-document=FILE | 把文档写到FILE文件中 |
|
||||
| -nc | –no-clobber | 不要覆盖存在的文件或使用.#前缀 |
|
||||
| -c | –continue | 接着下载没下载完的文件 |
|
||||
| | –progress=TYPE | 设定进程条标记 |
|
||||
| -N | –timestamping | 不要重新下载文件除非比本地文件新 |
|
||||
| -S | –server-response | 打印服务器的回应 |
|
||||
| | –spider | 不下载任何东西 |
|
||||
| -T | –timeout=SECONDS | 设定响应超时的秒数 |
|
||||
| -w | –wait=SECONDS | 两次尝试之间间隔SECONDS秒 |
|
||||
| | –waitretry=SECONDS | 在重新链接之间等待1…SECONDS秒 |
|
||||
| | –random-wait | 在下载之间等待0…2*WAIT秒 |
|
||||
| -Y | –proxy=on/off | 打开或关闭代理 |
|
||||
| -Q | –quota=NUMBER | 设置下载的容量限制 |
|
||||
| | –limit-rate=RATE | 限定下载速率 |
|
||||
|
||||
|
||||
|
||||
## 用户
|
||||
|
||||
who am i 查看当前用户
|
||||
@ -593,6 +641,25 @@ dpkg-reconfigure openssh-serve
|
||||
|
||||
FinalShell就可以连接WSL2了
|
||||
|
||||
#### 启用systemctl
|
||||
|
||||
进入当前发行版
|
||||
|
||||
编辑 /etc/wsl.conf
|
||||
|
||||
```shell
|
||||
vim /etc/wsl.conf
|
||||
# 内容如下
|
||||
[boot]
|
||||
systemd=true
|
||||
```
|
||||
|
||||
重启WSL
|
||||
|
||||
```powershell
|
||||
wsl --shutdown
|
||||
```
|
||||
|
||||
## 安装 Nginx
|
||||
|
||||
```shell
|
||||
@ -603,6 +670,69 @@ make
|
||||
make install
|
||||
```
|
||||
|
||||
AlmaLinux 下安装
|
||||
|
||||
```shell
|
||||
# 确保软件是最新的
|
||||
sudo dnf clean all
|
||||
sudo dnf update
|
||||
sudo dnf groupinstall "Development Tools"
|
||||
# 安装
|
||||
sudo dnf install nginx
|
||||
|
||||
sudo systemctl restart nginx
|
||||
sudo systemctl status nginx
|
||||
sudo systemctl enable nginx
|
||||
|
||||
sudo firewall-cmd --permanent --add-service=http
|
||||
sudo firewall-cmd --permanent --add-service=https
|
||||
sudo firewall-cmd --reload
|
||||
```
|
||||
|
||||
- `/etc/nginx`: 包含所有 Nginx 配置文件的主目录。
|
||||
- `/etc/nginx/nginx.conf`: 主要的 Nginx 配置文件。
|
||||
- `/etc/nginx/sites-available`:定义各个网站的目录。请记住,Nginx 不会使用在此目录中找到的配置文件,除非它们链接到该目录。`/etc/nginx/sites-enabled`
|
||||
- `/etc/nginx/sites-enabled`: Nginx 积极服务的网站列表。
|
||||
- `/var/log/nginx`: Nginx日志目录
|
||||
|
||||
## 安装 Redis
|
||||
|
||||
在安装Redis之前,运行下面的命令来重建软件包缓存并获得最新版本的软件包信息。
|
||||
|
||||
```shell
|
||||
sudo dnf makecache
|
||||
```
|
||||
|
||||
现在,运行下面的dnf命令来安装Redis。在提示时输入y,然后按ENTER键继续。
|
||||
|
||||
```shell
|
||||
sudo dnf install redis
|
||||
```
|
||||
|
||||
Redis安装完毕后,运行下面的systemctl命令,启动并启用Redis服务。
|
||||
|
||||
```shell
|
||||
sudo systemctl start redis
|
||||
sudo systemctl enable redis
|
||||
```
|
||||
|
||||
最后,使用下面的命令验证Redis的服务状态。
|
||||
|
||||
```shell
|
||||
sudo systemctl is-enabled redis
|
||||
sudo systemctl status redis
|
||||
```
|
||||
|
||||
下面的输出确认Redis正在运行并被启用,这意味着它将在系统启动时自动运行。
|
||||
|
||||
### 配置Redis
|
||||
|
||||
使用下面的vim编辑器命令打开Redis配置文件"/etc/redis.conf"。
|
||||
|
||||
```
|
||||
sudo vim /etc/redis.conf
|
||||
```
|
||||
|
||||
## 安装.Net 6 SDK
|
||||
|
||||
```shell
|
||||
@ -681,3 +811,46 @@ chmod +x /usr/bin/screenfetch
|
||||
screenfetch
|
||||
```
|
||||
|
||||
## 安装 Edge 和 Chrome
|
||||
|
||||
### Edge
|
||||
|
||||
更新源
|
||||
|
||||
```shell
|
||||
sudo dnf update -y
|
||||
#sudo dnf install dnf-utils -y
|
||||
```
|
||||
|
||||
添加Edge源
|
||||
|
||||
```shell
|
||||
sudo dnf config-manager --add-repo https://packages.microsoft.com/yumrepos/edgexxxxxxxxxx2 1sudo dnf confsudo dnf config-manager --add-repo https://packages.microsoft.com/yumrepos/edge2
|
||||
```
|
||||
|
||||
再次更新源
|
||||
|
||||
```shell
|
||||
sudo dnf update -y
|
||||
```
|
||||
|
||||
安装Edge
|
||||
|
||||
```shell
|
||||
sudo dnf install microsoft-edge-stable -y
|
||||
```
|
||||
|
||||
### Chrome
|
||||
|
||||
下载chrome安装文件
|
||||
|
||||
```shell
|
||||
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
|
||||
```
|
||||
|
||||
安装chrome
|
||||
|
||||
```shell
|
||||
sudo dnf install ./google-chrome-stable_current_x86_64.rpm -y
|
||||
```
|
||||
|
||||
|
||||
@ -1,51 +1,51 @@
|
||||
# MySQL
|
||||
|
||||
## mysqldump备份数据库
|
||||
|
||||
### 备份实例下的所有库
|
||||
# mysqldump备份数据库
|
||||
|
||||
## 备份实例下的所有库
|
||||
|
||||
```shell
|
||||
mysqldump -uroot -p -A > all.sql
|
||||
```
|
||||
|
||||
### 备份单个指定数据库
|
||||
## 备份单个指定数据库
|
||||
|
||||
```shell
|
||||
mysqldump -uroot -p test > test.sql
|
||||
```
|
||||
|
||||
### 备份多个指定数据库
|
||||
## 备份多个指定数据库
|
||||
|
||||
```shell
|
||||
mysqldump -uroot -p test1 test2 > test12.sql
|
||||
```
|
||||
|
||||
### 备份指定数据库中的单个表
|
||||
## 备份指定数据库中的单个表
|
||||
|
||||
```shell
|
||||
mysqldump -uroot -p test user > test.user.sql
|
||||
```
|
||||
|
||||
### 备份指定数据库中的多个表
|
||||
## 备份指定数据库中的多个表
|
||||
|
||||
```shell
|
||||
mysqldump -uroot -p test user role > test.ur.sql
|
||||
```
|
||||
|
||||
### 备份数据库表结构只包含DDL语句
|
||||
## 备份数据库表结构只包含DDL语句
|
||||
|
||||
```shell
|
||||
# --no-data 或 -d
|
||||
mysqldump -uroot -p test --no-data > test.sql
|
||||
```
|
||||
|
||||
### 备份数据库带库名
|
||||
## 备份数据库带库名
|
||||
|
||||
```shell
|
||||
mysqldump -uroot -p -B test > test.sql
|
||||
```
|
||||
|
||||
## Windows 下安装 绿色版
|
||||
# Windows 下安装 绿色版
|
||||
|
||||
先下载[MySQL :: Download MySQL Community Server](https://dev.mysql.com/downloads/mysql/)
|
||||
|
||||
@ -155,4 +155,68 @@ mysqldump -uroot -p -B test > test.sql
|
||||
mysqld --remove
|
||||
```
|
||||
|
||||
# Linux 安装MySQL客户端
|
||||
|
||||
## 安装
|
||||
|
||||
1. 在浏览器下载Linux系统的MySQL客户端安装包。建议您下载的MySQL客户端版本高于已创建的GaussDB(for MySQL)实例中数据库版本。
|
||||
在下载页面找到对应版本[链接](https://dev.mysql.com/downloads/file/?id=496982),以mysql-community-client-8.0.21-1.el6.x86_64为例,打开页面后,即可下载安装包。
|
||||

|
||||
|
||||
2. 将安装包上传到ECS。
|
||||
|
||||
3. 执行以下命令安装MySQL客户端。
|
||||
rpm -ivh mysql-community-client-8.0.21-1.el6.x86_64.rpm
|
||||
|
||||
> - 如果安装过程中报conflicts,可增加replacefiles参数重新安装,如下:
|
||||
>
|
||||
> rpm -ivh --replacefiles mysql-community-client-8.0.21-1.el6.x86_64.rpm
|
||||
>
|
||||
> - 如果安装过程中提示需要安装依赖包,可增加nodeps参数重新安装,如下:
|
||||
>
|
||||
> rpm -ivh --nodeps mysql-community-client-8.0.21-1.el6.x86_64.rpm
|
||||
|
||||
## 连接
|
||||
|
||||
1. **mysql -h** <*host*> **-P** *<port>* **-u** <*userName*> **-p**
|
||||
示例:
|
||||
|
||||
mysql -h 192.168.0.16 -P 3306 -u root -p
|
||||
|
||||
参数说明
|
||||
|
||||
| 参数 | 说明 |
|
||||
| ------------ | ---------------------------- |
|
||||
| <*host*> | 获取的读写内网地址。 |
|
||||
| *<port>* | 获取的数据库端口,默认3306。 |
|
||||
| <*userName*> | 管理员帐号root。 |
|
||||
|
||||
2. 出现如下提示时,输入数据库帐号对应的密码。
|
||||
```mysql
|
||||
Enter password:
|
||||
```
|
||||
|
||||
3. 报错mysql: error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory
|
||||
|
||||
下载rpm包:
|
||||
https://mirrors.aliyun.com/centos/8/AppStream/x86_64/os/Packages/compat-openssl10-1.0.2o-3.el8.x86_64.rpm
|
||||
安装rpm包:
|
||||
|
||||
```shell
|
||||
rpm -i compat-openssl10-1.0.2o-3.el8.x86_64.rpm
|
||||
错误:依赖检测失败:
|
||||
make 被 compat-openssl10-1:1.0.2o-3.el8.x86_64 需要
|
||||
rpm -i compat-openssl10-1.0.2o-3.el8.x86_64.rpm --nodeps --force
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
# MySQL 客户端
|
||||
|
||||
执行脚本
|
||||
|
||||
```mysql
|
||||
source <脚本绝对路径>
|
||||
```
|
||||
|
||||
|
||||
BIN
source/_posts/MySQL/zh-cn_image_0000001729034977.png
Normal file
BIN
source/_posts/MySQL/zh-cn_image_0000001729034977.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 60 KiB |
Loading…
x
Reference in New Issue
Block a user