update sales set city = '上海'where city = 'shanghai'; 这条语句报出 如下错误
update sales set city = '上海'where city = 'shanghai' Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column.
解决方案直接如下图
update sales set city = '上海'where city = 'shanghai';
show global variables like '%sql_safe_updates';
set global sql_safe_updates = 0;
将global 的变量sql_safe_updates = 0即可,mysql8.0默认是off状态