DELETE, UPDATE를 할 때 id를 참조하여 바꾸지 않으면 1175 에러가 난다.
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.
언제나 키 컬럼을 참조해서 row를 변경, 삭제할 수 있다면 좋을 것이지만, 간단한 테스트나 연습의 경우에는 그러기가 좀 곤란하다
그럴때는 safe mode를 해제해주면 된다.
set sql_safe_updates=0;
'했던것들 > MySQL' 카테고리의 다른 글
일대다(one to many) 관계 연습 (0) | 2023.07.30 |
---|---|
Error Code: 1093. You can't specify target table 'people' for update in FROM clause (0) | 2023.07.29 |
데이터베이스(SQL) 도입하기 (0) | 2023.02.02 |