监控记录数据库写入
SQL审计,统一放日志,在server.xml加入以下代码
<property name="sqlInterceptor">io.mycat.server.interceptor.impl.StatisticsSqlInterceptor</property><!-- 需Java 拦截的类-->
<property name="sqlInterceptorType">UPDATE,DELETE,INSERT</property> <!-- 记录操作类型-->
<property name="sqlInterceptorFile">/tmp/sqllog.txt</property>
控制访问的主机
统一屏蔽SQL语句,没有条件的Delete语句。在server.xml加入以下代码
<firewall>
<whitehost>
<host user="root" host="127.0.0.1"></host>
<blacklist check="true">
<property name="noneBaseStatementAllow">true</property> 是否允许ddl功能
<property name="deleteWhereNoneCheck">true</property> delete没条件不给删除
<blacklist>
</whitehost>
</firewall>
如果文章对您有帮助,欢迎移至上方按钮打赏,非常感谢你的支持!
全部评论