码迷,mamicode.com
首页 > 数据库 > 详细

MySQL参数

时间:2016-01-20 20:57:52      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:

1. sql_safe_updates

官方解释如下:

If set to 1, MySQL aborts UPDATE or DELETE statements that do not use a key in the WHERE clause or a LIMIT clause. (Specifically, UPDATE statements must have a WHERE clause that uses a key or a LIMIT clause, or both. DELETE statements must have both.) This makes it possible to catch UPDATE or DELETE statements where keys are not used properly and that would probably change or delete a large number of rows. The default value is 0.

默认为0,如果设置为1,则delete操作和update操作必须带有where子句,且where子句中的列必须是key或primary key,如果表设计的时候本来就没有设置key或primary key,则delete和update操作将不被允许,如果表设计的时候设置了key或者primary key,但where指定的是其它列,delete和update操作同样不被允许。

MySQL参数

标签:

原文地址:http://www.cnblogs.com/ivictor/p/5146373.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!