When using Mysql to execute update, if the primary key is not used in the where condition, the following error will be reported and the update cannot be executed.
Exception content: 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.
Solution:
this is because MySQL runs in the safe updates mode. Modify the database security mode to allow the update or delete commands to be executed under non primary key conditions.
Execute command:
SET SQL_SAFE_UPDATES = 0;
Read More:
- MYSQL Safe Upgraded Error: You are using safe update mode and you tried to update
- [Solved] MYSQL Command Execute Error: Can ‘t connect to local MySQL server through socket ‘/tmp/mysql.sock ‘(2) “
- MySQL Workbench: Error Code: 1175 [How to Solve]
- [Solved] Mysql Close safe-updates Mode Error: Error Code: 1175
- (Fixed) workbench MySQL Error Code: 2013. Lost connection to MySQL server during query
- MYSQL 5.7 Error Code: 1290. The MySQL server is running with the –secure-file-priv option so it..
- Mysql + Mybatis Batch Update Datas Error: BadSqlGrammarException
- Mysql Flashback Warning: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe
- [Solved] Error Code: 2013. Lost connection to MySQL server during query
- [Solved] ERROR 2002 (HY000): Can’t connect to local MySQL server through socket’/var/lib/mysql/mysql.sock’ (2)
- MYSQL: CURRENT_TIMESTAMP & ON UPDATE CURRENT_TIMESTAMP
- MySql Install Error: Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘
- MySQL startup error: vcruntime140_1.dll cannot be found, unable to continue code execution
- Mysql Script Error Code: 1136. Column count doesn’t match value count at row 1
- mysql workbench Error Code: 1046. No database selected Select the default DB to be used by doubl
- [Solved] MySQL Startup Error: Job for mysqld.service failed because the control process exited with error code
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
- How to Solve can‘t connect to local mysql server through socket ‘/var/lib/mysql/mysql.sock‘
- [Solved] MYSQL Master-Slave slave I/o for channel, error_code 1045
- MYSQL Insert Data Error: check the manual that corresponds to your MySQL server version for the right syntax