程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> MYSQL數據庫 >> MySQL綜合教程 >> MySQL參數,mysql

MySQL參數,mysql

編輯:MySQL綜合教程

MySQL參數,mysql


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操作同樣不被允許。

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved