MySQL reports a 1175 error when deleting and updating data.

Source: Internet
Author: User


The Error 1175 is reported when MySQL deletes the updated data. When a record in mysql database is deleted today, it cannot be deleted. The Error message is as follows: [html] Error Code: 1175. you are using safe update mode and you tried to update a table without a WHERE that [html] uses a KEY column To disable safe mode, toggle the option in Preferences-> SQL Editor-> Query Editor and reconnect. after searching for information, I found that mysql has a variable named SQL _SAFE_UPDATES. For the security of database update operations, the default value is 1, so the update fails. Under www.2cto.com, the values of SQL _SAFE_UPDATES are 0 and 1. SQL _SAFE_UPDATES has two values: 0 and 1. When SQL _SAFE_UPDATES is set to 1, the update and delete statements without the where and limit conditions cannot be executed. Even the update and delete statements with the where and limit conditions but without the key column cannot be executed. When SQL _SAFE_UPDATES = 0, the update and delete operations will be executed smoothly. Obviously, the default value of this variable is 1. Therefore, when a 1175 error occurs, you can set the SQL _SAFE_UPDATES value to 0 and then execute the update, for example, [SQL] SQL _SAFE_UPDATES = 0; delete from testTable where name = 'zhangsan ';
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.