数据库安全

1、限制sql执行delete与update语句必须添加条件。

mysql -uroot -proot -U  

执行delete语句没有带条件的话

delete from oldboy.student;  
ERROR 1175 (HY000): You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column  

如果想要执行删除语句的话

SET SQL_SAFE_UPDATES = 0;

 

posted @ 2019-03-15 11:05  苗士军  阅读(100)  评论(0编辑  收藏  举报