在应用mysql workbeach 进行表更新操作时遇到这个错误:
0 6 18:45:28 delete from wangba.user where Username=”张小寒” 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. 0.000 sec
原因:
在mysql 中默认安全的,既是主键必须在where 语句中,才能正确实现表数据更改。
解决办法:
set sql_safe_updates=0;
默认的
set sql_safe_updates=1;