MySQL关闭安全模式

来源:互联网 发布:浙江省软件协会网站 编辑:程序博客网 时间:2024/05/22 12:43

MySQL运行在safe-update模式下时,非主键条件下是无法执行update或者delete命令的

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.

查看安全模式开关,能够发现当前是启用状态

show variables like 'SQL_SAFE_UPDATES';

查看安全模式是否启用

直接将其关闭即可

SET SQL_SAFE_UPDATES = 0;

关闭后便可以正常执行update和delete命令了

delete from t_p_test ;

这里写图片描述

原创粉丝点击