赞
踩
- #Mybatis的配置
- #日志 让控制台打印sql语句
- logging.level.com.allen.druid.dao=debug
-
- #通过包扫描自定义别名,相等于mybatis的<typeAliases>的子标签<package name=com.allen.springbootmybatis.bean>
- #特别注意指定的包目录下,不能有重名的类,因为它是把类名首字母小写后变成别名即com.allen.springbootmybatis.bean.ScheduleBean别名是scheduleBean
- #别名的好处,就是你在xml文件,不用写类的全限定名,只要写别名即可
- mybatis.type-aliases-package=com.allen.springbootmybatis.bean
-
- #指定Mapper文件路径与名称(含匹配),扫描多个路径,中间以,分开 。支持通配符,建议每个都要以classpath*:开头
- mybatis.mapper-locations=classpath*:mappers/*Mapper.xml
-
-
- ##数据库连接配置信息
- spring.datasource.driverClassName =com.mysql.cj.jdbc.Driver
- spring.datasource.url = jdbc:mysql://localhost:3306/my_springboot?serverTimezone=UTC
- spring.datasource.username = root
- spring.datasource.password = root
-
- ##指定数据源类型
- spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
-

- ###########################Druid配置##########################
- #####连接池属性spring.datasource.druid.xxx=
- #启动连接池,默认开启
- #spring.datasource.druid.enable=true
-
- #使用Druid的数据库连接信息,我不建议使用此种 + 配置类,除非你对Druid特别熟悉
- #spring.datasource.druid.driver=com.mysql.cj.jdbc.Driver#指定driver的类名,默认从jdbc url中自动探测
- #spring.datasource.druid.driver-class-name使用这个,不用spring.datasource.druid.driver
- #spring.datasource.druid.driver-class-name=com.mysql.cj.jdbc.Driver
- #spring.datasource.druid.url=jdbc:mysql://localhost:3306/my_springboot?serverTimezone=UTC
- #spring.datasource.druid.username=root
- #spring.datasource.druid.password=root
-
- #获取连接时最大等待时间,单位毫秒
- #spring.datasource.druid.max-wait=10
- ##最大连接数
- #spring.datasource.druid.max-active=10
- ##最小连接池数量
- #spring.datasource.druid.min-idle=5
-
- #打开KeepAlive之后的效果
- #1>初始化连接池时会填充到minIdle数量。
- #2>连接池中的minIdle数量以内的连接,空闲时间超过minEvictableIdleTimeMillis,则会执行keepAlive操作。
- #3>当网络断开等原因产生的由ExceptionSorter检测出来的死连接被清除后,自动补充连接到minIdle数量。
- #连接池中的minIdle数量以内的连接,空闲时间超过minEvictableIdleTimeMillis,则会执行keepAlive操作
- #2次keepAlive操作的时间间隔
- #spring.datasource.druid.keep-alive-between-time-millis=50000
- #开启keepAlive操作
- spring.datasource.druid.keep-alive=true
-
- ###打开PSCache,并指定每个连接上PSCache的大小。oracle设为true,mysql设为false。分库分表较多推荐设置为false
- spring.datasource.druid.pool-prepared-statements=true
- spring.datasource.druid.max-pool-prepared-statement-per-connection-size=30
-
- ####检测,验证
- ##归还连接时会执行validationQuery检测连接是否有效,开启会降低性能,默认为true
- ####如果你的数据库经常断,必须使用此配置,否则系统需要重启(如果数据库异常有短信这类通知,建议关闭)
- spring.datasource.druid.test-on-return=false
- ##用来检测连接是否有效的sql 必须是一个查询语句,spring.datasource.druid.test-on-return设置true才能用
- ##mysql、oracle中为 select 1 from dual,不知道为啥mysql,网上推荐SELECT 'x'
- spring.datasource.druid.validation-query=select 1 from dual
- ##申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
- spring.datasource.druid.test-while-idle=true
- ## 当从连接池借用连接时,是否测试该连接,建议测试false
- spring.datasource.druid.test-on-borrow=false
-
- ##既作为检测的间隔时间又作为testWhileIdel执行的依据即此值决定是否空闲,因此此值一定要设置合理
- #即一个空闲线程,最大的生成时间。检测需要关闭的空闲连接
- #spring.datasource.druid.time-between-eviction-runs-millis=60000
- ##销毁线程时检测当前连接的最后活动时间和当前时间差大于该值时,关闭当前连接即一个连接在池中最小生存的时间
- #spring.datasource.druid.min-evictable-idle-time-millis=3000
-
- #指定连接变量。eg开启慢sql功能=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
- #spring.datasource.druid.connection-properties=String
-
- #合并多个DruidDataSource的监控数据
- #spring.datasource.druid.use-global-data-source-stat=true
-
- ##允许访问底层连接
- #spring.datasource.druid.access-to-underlying-connection-allowed=true
-
- #活跃连接堆跟踪
- #spring.datasource.druid.active-connection-stack-trace=List<String>
-
- #活跃连接列表
- #spring.datasource.druid.active-connections=Set<DruidPooledConnection>
-
-
-
- ##启用异步关闭连接
- #spring.datasource.druid.async-close-connection-enable=true
- #开启异步初始化
- #spring.datasource.druid.async-init=true
-
- #失败后跳过即用于失败重连,默认为false,true表示向数据库请求连接失败后,就算后端数据库恢复正常也不进行重连
- #因此一定要配置false
- #spring.datasource.druid.break-after-acquire-failure=false
-
- #检查执行sql执行时间
- #spring.datasource.druid.check-execute-time=true
-
- #启动清除过滤器
- #spring.datasource.druid.clear-filters-enable=false
-
-
- #连接出错尝试几次重新连接
- #spring.datasource.druid.connection-error-retry-attempts=2
-
- ####连接初始化语句即写sql语句,连接后会自动执行,用于测试比较好
- #spring.datasource.druid.connection-init-sqls=Collection<String>
- #spring.datasource.druid.connection-init-sqls=update t_schedule set status=0
-
- #创建定时器的连接池,跟数据库连接有关
- #spring.datasource.druid.create-scheduler=java.util.concurrent.ScheduledExecutorService
-
- #指定db类型,eg:h2、mysq、oracle
- #spring.datasource.druid.db-type=String
-
- #指定默认值:事务是否自动提交
- #spring.datasource.druid.default-auto-commit=true
-
- #指定连接默认的catalog.
- #spring.datasource.druid.default-catalog=String
-
- #是否设置默认连接只读.
- #spring.datasource.druid.default-read-only=true
-
- #指定连接的事务的默认隔离级别.
- #-1 数据库默认隔离级别
- #1 未提交读
- #2 读写提交
- #4 可重复读
- #8 串行化
- #spring.datasource.druid.default-transaction-isolation=Integer
-
- #指定销毁的定时连接池
- #spring.datasource.druid.destroy-scheduler=java.util.concurrent.ScheduledExecutorService
-
- ##启用DUP关闭日志
- #spring.datasource.druid.dup-close-log-enable=true
-
- #当数据库抛出不可恢复的异常时,抛弃该连接
- #spring.datasource.druid.exception-sorter=com.alibaba.druid.pool.ExceptionSorter
- #指定ExceptionSorter类名
- #spring.datasource.druid.exception-sorter-class-name=String
-
- #当创建连接池时,创建失败后是否立即抛异常
- #spring.datasource.druid.fail-fast=true
-
- #DruidStatProperties的aopPatterns字段即指定AOP模式
- #spring.datasource.druid.aop-patterns=String[]
- #Spring监控,对内部各接口调用的监控,参考Druid Github Wiki,配置_Druid和Spring关联监控配置
- #spring.datasource.druid.aop-patterns=com.allen.service.*,com.allen.dao.*,com.allen.controller.*,com.allen.mapper.*
-
- ###连接池初始化
- #开启线程初始化异常抛出异常
- #spring.datasource.druid.init-exception-throw=true
-
- #false #初始化全局变量
- #spring.datasource.druid.init-global-variants=true
- ##初始化变量
- #spring.datasource.druid.init-variants=true
-
- ##初始化时建立物理连接的个数
- #spring.datasource.druid.initial-size=10
-
-
- #socket连接超时时kil
- #spring.datasource.druid.kill-when-socket-read-timeout=true
- #记录丢失
- #spring.datasource.druid.log-abandoned=true
-
- #记录不同的线程
- #spring.datasource.druid.log-different-thread=true
-
- #指定连接数据库的超时时间
- #spring.datasource.druid.login-timeout=Integer
-
- #最大创建任务数
- #spring.datasource.druid.max-create-task-count=1000
- ##连接保持空闲而不被驱逐的最大时间.默认值1000L * 60L * 60L * 7,com.alibaba.druid.pool.DruidAbstractDataSource.maxEvictableIdleTimeMillis
- #spring.datasource.druid.max-evictable-idle-time-millis=1000
-
- #最大打开的prepared-statement数量
- #spring.datasource.druid.max-open-prepared-statements=1000
-
- #允许的最大线程等待数
- #spring.datasource.druid.max-wait-thread-count=10
-
- #指定连接池名称
- #spring.datasource.druid.name=String
- #设置获取连接时的重试次数,-1为不重试
- #spring.datasource.druid.not-full-timeout-retry-count=-1
-
- #????
- #spring.datasource.druid.object-name=
-
- #用于控制当OnFatalError发生时最大使用连接数量,用于控制异常发生时并发执行SQL的数量,减轻数据库恢复的压力。
- #默认值 0
- #spring.datasource.druid.on-fatal-error-max-active=Integer
-
- #是否是oracle数据库
- #spring.datasource.druid.oracle=false
-
- #用于解决数据库密码加密处理方法
- #public class AllenDbPasswordCallback extends DruidPasswordCallback {
- # private static final Logger LOGGER = LoggerFactory.getLogger(DbPasswordCallback.class);
- # @Override
- # public void setProperties(Properties properties) {
- # super.setProperties(properties);
- # 真实环境,这2个值存数据库
- # String password = (String) properties.get("password");
- # String publickey = (String) properties.get("publickey");
- # try {
- # String dbpassword = ConfigTools.decrypt(publickey, password);
- # setPassword(dbpassword.toCharArray());
- # } catch (Exception e) {
- # LOGGER.error("Druid ConfigTools.decrypt", e);
- # }
- # }
- #}
- #spring.datasource.druid.password-callback=javax.security.auth.callback.PasswordCallback
-
- #物理最大连接数
- #spring.datasource.druid.phy-max-use-count=1000
- #物理超时
- #spring.datasource.druid.phy-timeout-millis=Long
-
- #???
- #spring.datasource.druid.pooling-connection-info=List<Map<String,Object>>
-
- #指定代理过滤器
- #spring.datasource.druid.proxy-filters=List<Filter>
-
- #查询超时时间
- #spring.datasource.druid.query-timeout=Integer
-
- #指定当连接超过废弃超时时间时,是否立刻删除该连接.
- #spring.datasource.druid.remove-abandoned=true
- #指定连接应该被废弃的时间.
- #spring.datasource.druid.remove-abandoned-timeout=Integer
-
- #废弃连接超时指定时间的连接
- #spring.datasource.druid.remove-abandoned-timeout-millis=Long
-
- #启用重置统计信息
- #spring.datasource.druid.reset-stat-enable=true
-
- #共享预处理语句
- #spring.datasource.druid.share-prepared-statements=true
-
-
- #指定2次错误连接的最大时间间隔
- #spring.datasource.druid.time-between-connect-error-millis=
-
- #统计日志之间的时间
- #spring.datasource.druid.time-between-log-stats-millis=
-
- ##事务查询超时时间
- #spring.datasource.druid.transaction-query-timeout=Integer
-
- # 事务时间阈值
- #spring.datasource.druid.transaction-threshold-millis=Long
-
- #使用本地session是stat
- #spring.datasource.druid.use-local-session-state=true
-
- # 使用oracle隐式缓存
- #spring.datasource.druid.use-oracle-implicit-cache=true
- # 使用非公平锁
- #spring.datasource.druid.use-unfair-lock=true
-
- #com.alibaba.druid.pool.DruidAbstractDataSource.userCallback
- #spring.datasource.druid.user-callback=
-
- #指定连接的有效检查类
- #spring.datasource.druid.valid-connection-checker=com.alibaba.druid.pool.ValidConnectionChecker
- #spring.datasource.druid.valid-connection-checker-class-name=String
-
- #单位:秒,检测连接是否有效的超时时间。底层调用jdbc Statement对象的void setQueryTimeout(int seconds)方法
- #spring.datasource.druid.validation-query-timeout=Integer
-
-
-
- ################################filters#############################################
-
- # 配置扩展插件:配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
- #spring.datasource.druid.filters=String
-
- #sql无法统计时,去除wall
- #spring.datasource.druid.filters=stat,wall,log4j,config
-
- #允许一次执行多条语句,与spring.datasource.druid.filters的wall值有关
- #wall是com.alibaba.druid.wall.WallFilter的简称,提供sql的检查和过滤等功能
- # 默认对混合SQL进行拦截,此处为了执行大SQL,可关闭防火墙功能。
- #如果需要开启wall监控,同时允许multiStatementAllow,就不要在application中配置filter。
- #spring.datasource.druid.filter.wall.config.multi-statement-allow=true
-
- ####开启慢sql
- ##合并sql,默认false
- #spring.datasource.druid.filter.stat.merge-sql=true
- #spring.datasource.druid.filter.stat.log-slow-sql=true
- ##sql的执行时间超过1500毫秒就是慢sql
- #spring.datasource.druid.filter.stat.slow-sql-millis=1500
- ####慢sql结束
-
- #druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
- #spring.datasource.druid.connect-properties=Map<String,String>
- #eg:开启慢sql的另一种方式
- #spring.datasource.druid.connect-properties.=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
-
-
- #指定过滤器名称
- #spring.datasource.druid.filter-class-names=List<String>
-
- #启用Enable ConfigFilter
- #spring.datasource.druid.filter.config.enabled=true
-
- #启用EncodingConvertFilter
- #spring.datasource.druid.filter.encoding.enabled=true
-
- #???
- #spring.datasource.druid.sql-stat-map.=Map<String,JdbcSqlStat>
-
- #???
- #spring.datasource.druid.stat-data.=Map<String,Object>
-
- #????
- #spring.datasource.druid.stat-data-for-m-bean.=Map<String,Object>
-
- ##################################stat######################################
-
- #启用
- #spring.datasource.druid.filter.stat.enabled=true
-
- #指定stat的logger实现类
- #spring.datasource.druid.stat-logger=com.alibaba.druid.pool.DruidDataSourceStatLogger
-
- #指定stat的数据库类型
- #spring.datasource.druid.filter.stat.db-type=mysql
-
- #启动连接堆跟踪,com.alibaba.druid.filter.stat.StatFilter的connectionStackTraceEnable字段,默认false
- #spring.datasource.druid.filter.stat.connection-stack-trace-enable=true
-
-
- ###############################stat-view-servlet#######################
-
- # 白名单 ;com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties.StatViewServlet#allow
- #spring.datasource.druid.stat-view-servlet.allow=String
-
- #黑名单
- #spring.datasource.druid.stat-view-servlet.deny=String
-
- #开启
- #spring.datasource.druid.stat-view-servlet.enabled=true
- #登录密码
- #spring.datasource.druid.stat-view-servlet.login-password=
- #登录用户名
- #spring.datasource.druid.stat-view-servlet.login-username=
- #启用重置统计信息
- #spring.datasource.druid.stat-view-servlet.reset-enable=String
- ##访问路径
- #spring.datasource.druid.stat-view-servlet.url-pattern=String
-
-
- ###############################web-stat-filter#######################
- #启用开关
- #spring.datasource.druid.web-stat-filter.enabled=true
- # #排除URL com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties.WebStatFilter
- #spring.datasource.druid.web-stat-filter.exclusions= *.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*
-
- #身份标识 从session中获取spring.datasource.druid.web-stat-filter.principal-session-name=身份标识
- # 从cookie中获取 例如cookie中存gk=xiaoming 设置属性为gk即可
- #spring.datasource.druid.web-stat-filter.principal-session-name=String
- #spring.datasource.druid.web-stat-filter.principal-cookie-name=
-
- #配置profileEnable能够监控单个url调用的sql列表
- # com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties.WebStatFilter.profileEnable
- #spring.datasource.druid.web-stat-filter.profile-enable=String true
- #开关session统计功
- #spring.datasource.druid.web-stat-filter.session-stat-enable=true
-
- # 默认sessionStatMaxCount是1000个,你也可以按需要进行配置
- #spring.datasource.druid.web-stat-filter.session-stat-max-count=
-
- #statFilter的url模式,支持正则表达式
- #spring.datasource.druid.web-stat-filter.url-pattern=/*
- # 排除一些不必要的url,比如.js,/jslib/等等
- #spring.datasource.druid.web-stat-filter.exclusions=*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*
-
-
-
- ###############################防火墙开始filter.wall###############################
-
- #开启Wall功能
- #spring.datasource.druid.filter.wall.enabled=true
- #Map<String,Object>
- #spring.datasource.druid.wall-stat-map.=allen=java.lang.String;gk=allen
-
- #是否允许执行Alter Table语句
- #spring.datasource.druid.filter.wall.config.alter-table-allow=true
-
- #是否允许阻塞
- #spring.datasource.druid.filter.wall.config.block-allow=true
-
- #是否允许通过jdbc的call语法调用存储过程
- #spring.datasource.druid.filter.wall.config.call-allow=true
-
- #com.alibaba.druid.wall.WallConfig.caseConditionConstAllow
- #spring.datasource.druid.filter.wall.config.case-condition-const-allow=true
-
- #默认false 是否允许语句中存在注释,Oracle的用户不用担心,Wall能够识别hints和注释的区别
- #spring.datasource.druid.filter.wall.config.comment-allow=true
- #默认true 是否允许执行commit操作
- #spring.datasource.druid.filter.wall.config.commit-allow=true
-
- # 默认值:false ??
- #spring.datasource.druid.filter.wall.config.complete-insert-values-check=true
-
- #默认值false。检查查询条件(WHERE/HAVING子句)中是否包含AND永假条件
- #spring.datasource.druid.filter.wall.config.condition-and-alway-false-allow=true
-
- #默认值false:检查查询条件(WHERE/HAVING子句)中是否包含AND永真条件
- #spring.datasource.druid.filter.wall.config.condition-and-alway-true-allow=true
-
- #默认值false 查询条件中是否允许连续两个常量运算表达式
- #spring.datasource.druid.filter.wall.config.condition-double-const-allow=true
-
- #默认值true,检查查询条件(WHERE/HAVING子句)中是否包含LIKE永真条件
- #spring.datasource.druid.filter.wall.config.condition-like-true-allow=true
-
- #默认值:true。查询条件中是否允许有"&"、"~"、"|"、"^"运算符。
- #spring.datasource.druid.filter.wall.config.condition-op-bitwse-allow=true
-
- #默认值:false 查询条件中是否允许有XOR条件。XOR不常用,很难判断永真或者永假,缺省不允许。
- #spring.datasource.druid.filter.wall.config.condition-op-xor-allow=true
-
- #默认值true。拦截常量运算的条件,比如说WHERE FID = 3 - 1,其中"3 - 1"是常量运算表达式。
- #spring.datasource.druid.filter.wall.config.const-arithmetic-allow=true
-
- #默认值true,是否允许创建表
- #spring.datasource.druid.filter.wall.config.create-table-allow=true
-
- #默认值true,是否允许执行DELETE语句
- #spring.datasource.druid.filter.wall.config.delete-allow=true
-
- #默认true,检查DELETE语句的WHERE子句是否是一个永真条件
- #spring.datasource.druid.filter.wall.config.delete-where-alway-true-check=true
-
- #false,检查DELETE语句是否无where条件,这是有风险的,但不是SQL注入类型的风险
- #spring.datasource.druid.filter.wall.config.delete-where-none-check=true
-
- #???com.alibaba.druid.wall.WallConfig.denyFunctions
- #spring.datasource.druid.filter.wall.config.deny-functions=Set<String>
-
- #com.alibaba.druid.wall.WallConfig.denyObjects
- #spring.datasource.druid.filter.wall.config.deny-objects=Set<String>
-
- #com.alibaba.druid.wall.WallConfig.denySchemas
- #spring.datasource.druid.filter.wall.config.deny-schemas=Set<String>
-
- #com.alibaba.druid.wall.WallConfig.denyTables
- #spring.datasource.druid.filter.wall.config.deny-tables=Set<String>
-
-
- #com.alibaba.druid.wall.WallConfig.denyVariants
- #spring.datasource.druid.filter.wall.config.deny-variants=
-
- #true 是否允许执行mysql的describe语句,缺省打开
- #spring.datasource.druid.filter.wall.config.describe-allow=true
-
- #按照dbType分别配置: mysql : META-INF/druid/wall/mysql oracle : META-INF/druid/wall/oracle sqlserver : META-INF/druid/wall/sqlserver
- #spring.datasource.druid.filter.wall.config.dir=String
-
- #false,特权允许
- #spring.datasource.druid.filter.wall.config.do-privileged-allow=true
-
- #true 是否允许修改表
- #spring.datasource.druid.filter.wall.config.drop-table-allow=true
-
- #true,检测是否使用了禁用的函数
- #spring.datasource.druid.filter.wall.config.function-check=true
-
- #spring.datasource.druid.filter.wall.config.hint-allow=true
-
- #???
- #spring.datasource.druid.filter.wall.config.inited=true
-
- #true,是否允许执行INSERT语句
- #spring.datasource.druid.filter.wall.config.insert-allow=true
-
-
- #默认值3
- #spring.datasource.druid.filter.wall.config.insert-values-check-size=Integer
-
- #true,是否允许SELECT FROM A INTERSECT SELECT FROM B这样的语句
- #spring.datasource.druid.filter.wall.config.intersect-allow=true
-
- #false,是否允许limit 0这样的语句
- #spring.datasource.druid.filter.wall.config.limit-zero-allow=true
-
- #true,锁表允许
- #spring.datasource.druid.filter.wall.config.lock-table-allow=true
-
- #true,是否允许执行MERGE语句,这个只在Oracle中有用
- #spring.datasource.druid.filter.wall.config.merge-allow=true
-
- #true,是否允许调用Connection.getMetadata方法,这个方法调用会暴露数据库的表信息
- #spring.datasource.druid.filter.wall.config.metadata-allow=true
-
- #true,是否允许SELECT FROM A MINUS SELECT FROM B这样的语句
- #spring.datasource.druid.filter.wall.config.minus-allow=true
-
- #false。是否必须参数化,如果为True,则不允许类似WHERE ID = 1这种不参数化的SQL
- #spring.datasource.druid.filter.wall.config.must-parameterized=true
-
- #false。是否允许非以上基本语句的其他语句,缺省关闭,通过这个选项就能够屏蔽DDL。
- #spring.datasource.druid.filter.wall.config.none-base-statement-allow=true
-
- #true,检测是否使用了“禁用对对象”
- #spring.datasource.druid.filter.wall.config.object-check=true
-
- #???
- #spring.datasource.druid.filter.wall.config.permit-functions=Set<String>
-
- # 允许的schemas集合
- #spring.datasource.druid.filter.wall.config.permit-schemas=Set<String>
-
- #允许table名集合
- #spring.datasource.druid.filter.wall.config.permit-tables=Set<String>
-
- #允许变量集合
- #spring.datasource.druid.filter.wall.config.permit-variants=Set<String>
-
- #只允许读的表
- #spring.datasource.druid.filter.wall.config.read-only-tables=Set<String>
-
- #true。是否允许表重命名
- #spring.datasource.druid.filter.wall.config.rename-table-allow=true
-
- #true。是否允许执行REPLACE语句
- #spring.datasource.druid.filter.wall.config.replace-allow=true
-
- #true。是否允许执行roll back操作
- #spring.datasource.druid.filter.wall.config.rollback-allow=true
-
- #true,检测是否使用了禁用的Schema
- #spring.datasource.druid.filter.wall.config.schema-check=true
-
- # ??? true,不允许执行select * from t,但select from (select id, name from t) a。
- # 这个选项是防御程序通过调用select 获得数据表的结构信息。
- #spring.datasource.druid.filter.wall.config.select-all-column-allow=true
-
- #true,检测SELECT EXCEPT
- #spring.datasource.druid.filter.wall.config.select-except-check=true
-
- #true,检查SELECT语句的HAVING子句是否是一个永真条件
- #spring.datasource.druid.filter.wall.config.select-having-alway-true-check=true
-
- #true,检测SELECT INTERSECT
- #spring.datasource.druid.filter.wall.config.select-intersect-check=true
-
- #true,SELECT查询中是否允许INTO字句
- #spring.datasource.druid.filter.wall.config.select-into-allow=true
-
- #true.SELECT … INTO OUTFILE 是否允许,这个是mysql注入攻击的常见手段,缺省是禁止的
- #spring.datasource.druid.filter.wall.config.select-into-outfile-allow=true
-
- #默认值-1;配置最大返回行数,如果select语句没有指定最大返回行数,会自动修改selct添加返回限制
- #spring.datasource.druid.filter.wall.config.select-limit=Integer
-
- #true,检测SELECT MINUS
- #spring.datasource.druid.filter.wall.config.select-minus-check=true
-
- #true,检测SELECT union
- #spring.datasource.druid.filter.wall.config.select-union-check=true
-
- #true,检查SELECT语句的WHERE子句是否是一个永真条件
- #spring.datasource.druid.filter.wall.config.select-where-alway-true-check=true
-
- #true,是否允许执行SELECT语句
- #spring.datasource.druid.filter.wall.config.selelct-allow=true
- #true.是否允许使用SET语法
- #spring.datasource.druid.filter.wall.config.set-allow=true
-
- #true.是否允许执行mysql的show语句,缺省打开
- #spring.datasource.druid.filter.wall.config.show-allow=true
-
- #true.是否允许开启事务
- #spring.datasource.druid.filter.wall.config.start-transaction-allow=true
-
- #true, 是否进行严格的语法检测,
- # Druid SQL Parser在某些场景不能覆盖所有的SQL语法,出现解析SQL出错,可以临时把这个选项设置为false,同时把SQL反馈给Druid的开发者。
- #spring.datasource.druid.filter.wall.config.strict-syntax-check=true
-
- #true,检测是否使用了禁用的表
- #spring.datasource.druid.filter.wall.config.table-check=true
-
- #??
- #spring.datasource.druid.filter.wall.config.tenant-column=String
- #???
- #spring.datasource.druid.filter.wall.config.tenant-table-pattern=String
-
- #true,truncate语句是危险,缺省打开,若需要自行关闭
- #spring.datasource.druid.filter.wall.config.truncate-allow=true
-
- #true,是否允许update语法
- #spring.datasource.druid.filter.wall.config.update-allow=true
-
- #指定UpdateCheck处理器
- #spring.datasource.druid.filter.wall.config.update-check-handler=com.alibaba.druid.wall.WallUpdateCheckHandler
-
- #true.检查UPDATE语句的WHERE子句是否是一个永真条件
- #spring.datasource.druid.filter.wall.config.update-where-alay-true-check=true
-
- #false,检查UPDATE语句是否无where条件,这是有风险的,但不是SQL注入类型的风险
- #spring.datasource.druid.filter.wall.config.update-where-none-check=true
-
- #true,是否允许执行mysql的use语句,缺省打开
- #spring.datasource.druid.filter.wall.config.use-allow=true
-
- #true.检测是否使用了“禁用的变量”
- #spring.datasource.druid.filter.wall.config.variant-check=true
-
- #true,是否允许调用Connection/Statement/ResultSet的isWrapFor和unwrap方法,
- # 这两个方法调用,使得有办法拿到原生驱动的对象,绕过WallFilter的检测直接执行SQL。
- #spring.datasource.druid.filter.wall.config.wrap-allow=true
-
- #指定Wall的配置类,可以继承WallConfig类,然后指定即可
- #spring.datasource.druid.filter.wall.config=com.alibaba.druid.wall.WallConfig
-
- #指定数据库类型,mysql
- #spring.datasource.druid.filter.wall.db-type=String
-
- #默认false,对被认为是攻击的SQL进行LOG.error输出
- #spring.datasource.druid.filter.wall.log-violation=true
-
- #provider 白名单 ???
- #spring.datasource.druid.filter.wall.provider-white-list=Set<String>
- #???
- #spring.datasource.druid.filter.wall.tenant-column=String
-
- #true,对被认为是攻击的SQL抛出SQLException
- #spring.datasource.druid.filter.wall.throw-exception=true
- ###防火墙结束
-
-
-
- ###################################日志的处理###################################
-
- ########################commons-log 日志开始#####################
- #spring.datasource.druid.filter.commons-log.connection-close-after-log-enabled=true
- #spring.datasource.druid.filter.commons-log.connection-commit-after-log-enabled=true
- #spring.datasource.druid.filter.commons-log.connection-connect-after-log-enabled=true
- #spring.datasource.druid.filter.commons-log.connection-connect-before-log-enabled=true
- #spring.datasource.druid.filter.commons-log.connection-log-enabled=true
- #spring.datasource.druid.filter.commons-log.connection-log-error-enabled=true
- #spring.datasource.druid.filter.commons-log.connection-logger-name=
- #spring.datasource.druid.filter.commons-log.connection-rollback-after-log-enabled=true
- #spring.datasource.druid.filter.commons-log.data-source-log-enabled=true
- #spring.datasource.druid.filter.commons-log.data-source-logger-name=
- #spring.datasource.druid.filter.commons-log.enabled=true
- #spring.datasource.druid.filter.commons-log.result-set-close-after-log-enabled=true
- #spring.datasource.druid.filter.commons-log.result-set-log-enabled=true
- #spring.datasource.druid.filter.commons-log.result-set-log-error-enabled=true
- #spring.datasource.druid.filter.commons-log.result-set-logger-name=
- #spring.datasource.druid.filter.commons-log.result-set-next-after-log-enabled=true
- #spring.datasource.druid.filter.commons-log.result-set-open-after-log-enabled=true
- #spring.datasource.druid.filter.commons-log.statement-close-after-log-enabled=true
- #spring.datasource.druid.filter.commons-log.statement-create-after-log-enabled=true
- #spring.datasource.druid.filter.commons-log.statement-executable-sql-log-enable=true
- #spring.datasource.druid.filter.commons-log.statement-execute-after-log-enabled=true
- #spring.datasource.druid.filter.commons-log.statement-execute-batch-after-log-enabled=true
- #spring.datasource.druid.filter.commons-log.statement-execute-query-after-log-enabled=true
- #spring.datasource.druid.filter.commons-log.statement-execute-update-after-log-enabled=true
- #spring.datasource.druid.filter.commons-log.statement-log-enabled=true
- #spring.datasource.druid.filter.commons-log.statement-log-error-enabled=true
- #spring.datasource.druid.filter.commons-log.statement-logger-name=
- #spring.datasource.druid.filter.commons-log.statement-parameter-clear-log-enable=true
- #spring.datasource.druid.filter.commons-log.statement-parameter-set-log-enabled=true
- #spring.datasource.druid.filter.commons-log.statement-prepare-after-log-enabled=true
- #spring.datasource.druid.filter.commons-log.statement-prepare-call-after-log-enabled=true
- #spring.datasource.druid.filter.commons-log.statement-sql-format-option=
- #spring.datasource.druid.filter.commons-log.statement-sql-pretty-format=true
- ##commons-log 日志结束
-
-
- ########################日志log4j开始 日志开始#####################
- ###
- #spring.datasource.druid.filter.log4j.connection-close-after-log-enabled=true
- #spring.datasource.druid.filter.log4j.connection-commit-after-log-enabled=true
- #spring.datasource.druid.filter.log4j.connection-connect-after-log-enabled=true
- #spring.datasource.druid.filter.log4j.connection-connect-before-log-enabled=true
- #spring.datasource.druid.filter.log4j.connection-log-enabled=true
- #spring.datasource.druid.filter.log4j.connection-log-error-enabled=true
- #spring.datasource.druid.filter.log4j.connection-logger-name=
- #spring.datasource.druid.filter.log4j.connection-rollback-after-log-enabled=true
- #spring.datasource.druid.filter.log4j.data-source-log-enabled=true
- #spring.datasource.druid.filter.log4j.data-source-logger-name=
- #spring.datasource.druid.filter.log4j.enabled=true
- #spring.datasource.druid.filter.log4j.result-set-close-after-log-enabled=true
- #spring.datasource.druid.filter.log4j.result-set-log-enabled=true
- #spring.datasource.druid.filter.log4j.result-set-log-error-enabled=true
- #spring.datasource.druid.filter.log4j.result-set-logger-name=
- #spring.datasource.druid.filter.log4j.result-set-next-after-log-enabled=true
- #spring.datasource.druid.filter.log4j.result-set-open-after-log-enabled=true
- #spring.datasource.druid.filter.log4j.statement-close-after-log-enabled=true
- #spring.datasource.druid.filter.log4j.statement-create-after-log-enabled=true
- #spring.datasource.druid.filter.log4j.statement-executable-sql-log-enable=true
- #spring.datasource.druid.filter.log4j.statement-execute-after-log-enabled=true
- #spring.datasource.druid.filter.log4j.statement-execute-batch-after-log-enabled=true
- #spring.datasource.druid.filter.log4j.statement-execute-query-after-log-enabled=true
- #spring.datasource.druid.filter.log4j.statement-execute-update-after-log-enabled=true
- #spring.datasource.druid.filter.log4j.statement-log-enabled=true
- #spring.datasource.druid.filter.log4j.statement-log-error-enabled=true
- #spring.datasource.druid.filter.log4j.statement-logger-name=
- #spring.datasource.druid.filter.log4j.statement-parameter-clear-log-enable=true
- #spring.datasource.druid.filter.log4j.statement-parameter-set-log-enabled=true
- #spring.datasource.druid.filter.log4j.statement-prepare-after-log-enabled=true
- #spring.datasource.druid.filter.log4j.statement-prepare-call-after-log-enabled=true
- #spring.datasource.druid.filter.log4j.statement-sql-format-option=
- #spring.datasource.druid.filter.log4j.statement-sql-pretty-format=true
- ###日志log4j结束
-
- ########################日志log4j2日志开始#####################
- ###
- #spring.datasource.druid.filter.log4j2.connection-close-after-log-enabled=true
- #spring.datasource.druid.filter.log4j2.connection-commit-after-log-enabled=true
- #spring.datasource.druid.filter.log4j2.connection-connect-after-log-enabled=true
- #spring.datasource.druid.filter.log4j2.connection-connect-before-log-enabled=true
- #spring.datasource.druid.filter.log4j2.connection-log-enabled=true
- #spring.datasource.druid.filter.log4j2.connection-log-error-enabled=true
- #spring.datasource.druid.filter.log4j2.connection-logger-name=
- #spring.datasource.druid.filter.log4j2.connection-rollback-after-log-enabled=true
- #spring.datasource.druid.filter.log4j2.data-source-log-enabled=true
- #spring.datasource.druid.filter.log4j2.data-source-logger-name=
- #spring.datasource.druid.filter.log4j2.enabled=true
- #spring.datasource.druid.filter.log4j2.result-set-close-after-log-enabled=true
- #spring.datasource.druid.filter.log4j2.result-set-log-enabled=true
- #spring.datasource.druid.filter.log4j2.result-set-log-error-enabled=true
- #spring.datasource.druid.filter.log4j2.result-set-logger-name=
- #spring.datasource.druid.filter.log4j2.result-set-next-after-log-enabled=true
- #spring.datasource.druid.filter.log4j2.result-set-open-after-log-enabled=true
- #spring.datasource.druid.filter.log4j2.statement-close-after-log-enabled=true
- #spring.datasource.druid.filter.log4j2.statement-create-after-log-enabled=true
- #spring.datasource.druid.filter.log4j2.statement-executable-sql-log-enable=true
- #spring.datasource.druid.filter.log4j2.statement-execute-after-log-enabled=true
- #spring.datasource.druid.filter.log4j2.statement-execute-batch-after-log-enabled=true
- #spring.datasource.druid.filter.log4j2.statement-execute-query-after-log-enabled=true
- #spring.datasource.druid.filter.log4j2.statement-execute-update-after-log-enabled=true
- #spring.datasource.druid.filter.log4j2.statement-log-enabled=true
- #spring.datasource.druid.filter.log4j2.statement-log-error-enabled=true
- #spring.datasource.druid.filter.log4j2.statement-logger-name=
- #spring.datasource.druid.filter.log4j2.statement-parameter-clear-log-enable=true
- #spring.datasource.druid.filter.log4j2.statement-parameter-set-log-enabled=true
- #spring.datasource.druid.filter.log4j2.statement-prepare-after-log-enabled=true
- #spring.datasource.druid.filter.log4j2.statement-prepare-call-after-log-enabled=true
- #spring.datasource.druid.filter.log4j2.statement-sql-format-option=
- #spring.datasource.druid.filter.log4j2.statement-sql-pretty-format=true
- ###日志log4j2结束

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。