b>j)΄!Pԫ&;"kB޶}pSVT(wę!j x;-m@JnQ+պכ7MajfJͱ4jѲ撆RxZMz7vIW/dٞТזcZM~ji ߒsQzԠDW3Den"M+/B:-uIJ7j委9p='mANޭ=/B:-n&nUfqxZM~c Ϲ+,&ᾺܢF[(1*" ϒ"Jԧ<;b" "jܢF[x ,!q қ*]/؝27SMcs"ޭDQ/应ܢF_! :s" 7`F+SVTn"IJnQ/应B 4 wD"IJ׭-`S9DrjiEJ߅gJ应矁[xZM~n"IB؃!'Тѕ+(mIKʭ/|ϐܢF[xZMzG %嬩/c[[ Can't delete records in MySQL Workbench - Mkyong.com

Can’t delete records in MySQL Workbench

In MySQL workbench, issue a simple delete all commands


delete FROM users;

But it shows me following error message :


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 Queries and reconnect.
cant-delete-mysql

Solution

By default, MySQL workbench is started in safe mode, and can’t update or delete, without a “WHERE” condition, see the error message.

To fix it, in menu, selects “Edit” -> “Preferences” -> “SQL Queries”, uncheck the “Safe Updates” checkbox.

cant-delete-mysql-preference

Done, try reconnect and issue the delete command again.

mkyong

Founder of Mkyong.com, passionate Java and open-source technologies. If you enjoy my tutorials, consider making a donation to these charities.

4 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
jitesh dundas
11 years ago

Nope – it did not work. Try using this query before executing the delete. It should work:-
SET SQL_SAFE_UPDATES=0;

Harvey
4 years ago
Reply to  jitesh dundas

Thank you ,it’s working!!

Grant
11 years ago

Is there a way to execute the following without disabling the SQL_Safe_Updates as I dont want to make config changes on a LIVE/Production database?

DELETE FROM app_role_permissions WHERE permissions LIKE ‘%ELEMENT%’;

totha
12 years ago

Also a solution, if you put a “WHERE 1” part to the DELETE statement