批量更新数据报错, 包括额外套一层也会报错, 网上找了圈没有找到答案

update tb1
,(select id from tb1 where id in (123)) daa
set tb1.value=1
where tb1.id=daa.id

按我下面的写法即可解决

update tb1
,(select id from tb1 where id in (123) limit 9999999) daa
set tb1.value=1
where tb1.id=daa.id

  • 转发内容替换(不支持长链接内容替换)
# 关闭gzip
gunzip on;
gzip_disable ".";

# 转发内容全局替换
proxy_redirect off; 
sub_filter_once     off; # off为多次替换,默认值为on仅仅替换一次
sub_filter_types *; # 替换的content-type类型
sub_filter "hometree-ts.oss-cn-shanghai.aliyuncs.com" "hometree-ts.oss-accelerate.aliyuncs.com";
sub_filter "oss-ts.jiayuanshu.net" "hometree-ts.oss-accelerate.aliyuncs.com";

sub_filter "hometree.oss-cn-shanghai.aliyuncs.com" "hometree.oss-accelerate.aliyuncs.com";
sub_filter "oss.jiayuanshu.net" "hometree.oss-accelerate.aliyuncs.com";
sub_filter "hometree.oss.jiayuanshu.net" "hometree.oss-accelerate.aliyuncs.com";


sub_filter 指令
sub_filter string replacement。将string替换成replacement,不区分大小写。
sub_filter_last_modified on | off。默认:off,防止缓存。是否在Response header中写入Last-Modified,控制缓存。
sub_filter_once on | off。默认: on,只执行一次。sub_filter指令是执行一次,还是重复执行。
sub_filter_types mime-type …。默认: text/html。指定类型的MINE TYPE,如果所有类型,则使用:*。
  • 自动转发且自动帮助登录
location /online_api1/ {
    proxy_set_header Authorization 'Bearer eyJ0eXJ9.eyJpc3MiiA';
    proxy_pass https://api.test.cn/; 
}
  • 微服务2种配置方式
 # 访问 /*/aaa 实际请求 http://localhost:9501/aaa
location /abcd/ {
            proxy_pass http://localhost:9501/;
}
location ~ /abcd(/|$)(.*) { 
    proxy_pass http://localhost:9501/$2;
}

# 访问 /*/aaa 实际请求 http://localhost:9501/aaa 
location ~ /[a-z_0-9]+(/|$)(.*) { # 为列出来的都转发到该接口 
    if ($query_string = ''){
        proxy_pass http://t.wuloves.com/$2;
    }
    proxy_pass http://t.wuloves.com/$2?$query_string;
}
  • location 携带参数
location ^~ /abc {
    proxy_set_header    Host $host;
    proxy_set_header    X-Real-IP  $remote_addr;
    proxy_pass http://127.0.0.1:8081/;
}
  • 路径转发
location /callback/ {
    proxy_pass http://www.baidu.com/;
}
# 网上有人说https协议不能访问, 测试实际访问是http, 配置中转发到https转发正常, 同样实际测试转发的域名是无法将域名替代为ip通过https访问的
# 当前被访问的为https未测试
location /https/ {
    proxy_pass https://www.baidu.com/;
}

# 重点,转发websocket需要的设置
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection $connection upgrade;

  • 执行安装
yum install squid -y
yum install httpd-tools -y
  • 生成密码文件
mkdir /etc/squid3/
#wuloves 是用户名
htpasswd -cd /etc/squid3/passwords wuloves
#提示输入密码,比如输入12345678, 这边限制密码长度必须为8位数

test 12345678
  • 测试密码
/usr/lib64/squid/basic_ncsa_auth /etc/squid3/passwords
#输入用户名 密码
test  12345678
#提示ok说明成功
ok
#ctrl+c退出
  • 配置squid.conf文件
vi /etc/squid/squid.conf
#在最前面添加,如果密码认证放在 http_access allow all 后面,会有可能导致密码不鉴权了
auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid3/passwords
auth_param basic realm proxy
acl authenticated proxy_auth REQUIRED
http_access allow authenticated

# And finally deny all other access to this proxy
http_access allow all

#这里是端口号,可以按需修改
#http_port 3128 这样写会同时监听ipv6和ipv4的端口,推荐适应下面的配置方法。
http_port 0.0.0.0:3128
  • 启动,停止,重启等
#启动start
systemctl start squid.service
#停止stop
systemctl stop squid.service
#重启stop
systemctl restart squid.service
#配置开机自启动
systemctl enable squid.service
#关闭开机自启动
systemctl disable squid.service
#查看运行状态
systemctl status squid.service
  • 测试代理访问

firewall-cmd --permanent --zone=public --add-port=444/tcp
systemctl restart firewalld.service

测试
curl -x test:12345678@192.168.3.6:3128 https://www.wuloves.com

下面是配置方式2

yum install squid
systemctl restart squid.service
systemctl enable squid.service

编辑配置文件, 在开头处增加即可
vim /etc/squid/squid.conf

acl localnet src 0.0.0.0/0
# http_port 3128 >>> http_port 3129

重启服务即可

默认代理端口 3128

遇到问题
Google不能访问,github正常,在对应的主机上访问Google正常
是因为代理被大陆网关给拦截了

tracteroute路由追踪正常

代理使用增加鉴权

  • htpasswd生成passwd文件并创建用户 squiduser
htpasswd  -c /etc/squid/passwd squiduser

如果命令不能使用, 执行 
yum install httpd
  • /etc/squid/squid.conf 增加内容
auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/passwd
acl auth_user proxy_auth REQUIRED
http_access allow auth_user
  • 重启squid #systemctl restart squid

  • 下载链接
http://isoredirect.centos.org/centos/7/isos/x86_64/

http://mirrors.aliyun.com/centos/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso
973.0 MB    2020-11-03 22:55
  • 安装后需要做的基本动作
[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# vi ifcfg-ens32
ifcfg-ens32  ifcfg-lo

修改为 ONBOOT=yes
[root@localhost network-scripts]# service network restart

[root@localhost ~]# yum install net-tools -y
使用命令yum install net-tools -y安装,完成以后,ifconfig就可以用了

  • 黑群晖7.0安装文档参考
https://wp.gxnas.com/11849.html
https://dl.gxnas.com:1443/?dir=/%E9%BB%91%E7%BE%A4%E6%99%96/%E9%BB%91%E7%BE%A4%E6%99%96DSM6.24%E5%92%8CDSM7.x%E6%B5%8B%E8%AF%95%E7%89%88
  • img转换vdi虚拟磁盘文件
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" convertdd DS918+_7.1.0-42661.img ds_test7_index.vdi