摘要:
配置阿里云yum源 下载配置文件 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 生成缓存 yum makecache 安装redis 1、安装依赖 yum install 阅读全文
posted @ 2021-09-13 20:29
学海无涯,书山有路
阅读(23)
评论(0)
推荐(0)
摘要:
使用连接池有两种方式 1.使用DBCP,在maven项目中导入包 <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-dbcp2 --> <dependency> <groupId>org.apache.commons 阅读全文
posted @ 2021-09-13 20:21
学海无涯,书山有路
阅读(59)
评论(0)
推荐(0)
摘要:
解析json字符串有两种方式 1.使用谷歌的Gson,在maven项目的pom文件中导入包 <!-- https://mvnrepository.com/artifact/com.google.code.gson/gson --> <dependency> <groupId>com.google.c 阅读全文
posted @ 2021-09-13 20:03
学海无涯,书山有路
阅读(524)
评论(0)
推荐(0)
摘要:
shell操作mysql #!/bin/sh MYSQL="mysql -hmaster -uroot -p123456" sql="select * from shujia.student where sex='0'" result="$($MYSQL -e "$sql")" echo "$res 阅读全文
posted @ 2021-09-13 19:39
学海无涯,书山有路
阅读(30)
评论(0)
推荐(0)
摘要:
case:值的替换 格式: case when 条件 then 为true的结果 [when 条件 then 为true的结果] [else 为false的结果] end 从其他表加载数据 格式1: create table 表名 as 查询语句; 格式2: insert into 表名 查询语句; 阅读全文
posted @ 2021-09-13 19:30
学海无涯,书山有路
阅读(24)
评论(0)
推荐(0)
摘要:
连表联查 union:结果集进行合并(纵向合并) 格式: 查询语句 union 查询语句 注意: 查询列数必须相同 字段为第一个sql语句的字段 union默认去重 union all不去重 left join(以左表为基准关联右表中的数据) 格式: select * from 左表 left jo 阅读全文
posted @ 2021-09-13 19:24
学海无涯,书山有路
阅读(27)
评论(0)
推荐(0)
摘要:
字段进行算术运算 格式: (字段 符号 字段) 例如: select (name+age) from students; 注意: 字符串参与运算字符串为0参与运算 拼接: 格式: concat(str1,str2...) 例如:把name和age以-拼接显示 select concat(name,' 阅读全文
posted @ 2021-09-13 19:21
学海无涯,书山有路
阅读(30)
评论(0)
推荐(0)
摘要:
set @@global.sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; 然后关闭连接 阅读全文
posted @ 2021-09-13 19:18
学海无涯,书山有路
阅读(38)
评论(0)
推荐(0)
摘要:
1、关闭防火墙 systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 查看防火墙状态 systemctl status firewalld.service 启动 阅读全文
posted @ 2021-09-13 19:13
学海无涯,书山有路
阅读(13)
评论(0)
推荐(0)
浙公网安备 33010602011771号