修改数据库安全等级

今天修改程序发现更新数据总是失败,更新语句这样写的:

update WC_COMPANY_INVOICE set isvalid = 0  where id = '4D310B1742150CB7E0532012090A6F6C';

此时,id字段是非主键或外键的。这样更新总是提示:

Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column  
To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect.

查的资料原来是和数据库安全登记有关,

SET SQL_SAFE_UPDATES = 0;

这样就可以了,

SET SQL_SAFE_UPDATES = 1;

这样就又恢复了
这个问题在orcale数据库是没有的

猜你喜欢

转载自blog.csdn.net/u010715440/article/details/79504082
今日推荐