2020-09-11

MySQL禁用安全模式

我们使用MySQL8.0执行update的时候,where语句如果不是用的主键,就会报错: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 您正在使用安全更新模式,并试图更新一个没有使用键列的WHERE的表。
要禁用安全模式,在首选项-> SQL编辑器中切换选项并重新连接。
所以此时我们需要禁用安全模式,只需执行以下语句即可:
set sql_safe_updates=0;

猜你喜欢

转载自blog.csdn.net/ban0325/article/details/108531253