0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【MySQL】Error Code: 1175. You are using...の対処方法

Posted at

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.060 sec

MySQLWorkbenchで、DELETEや UPDATEのSQLコマンドを実行すると、このようなエラーが発生することがあります。

対処方法

MySQLWorkbenchのPreferencesを選択します。

スクリーンショット-2020-07-14-22.02.22.png

左のタブでSQL Editorを選択し、Other欄のSafe Update (rejects UPDATEs and DELETEs with no restrictions)のチェックを外します。

スクリーンショット-2020-07-14-22.04.30.png

チェックを外すと、エラーが取れていると思います。
(それでもダメな場合は、再接続・再起動を試してください)

tips

SQLのUPDATEやDELETEコマンドは非常に強力です。

たった一行で、全てのデータを書き換え、全てのデータを消すことができてしまうのです。
誤って実行してしまうと考えたらやばいですよね。

そこで、今回のようなチェックボックスを設けることで、DBを守るという仕組みになっているのです。

チェックボックスがついたままだと、WHERE句で指定をしないと、UPDATEやDELETEは使えないと思います。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?