Wednesday, January 23, 2013

To execute the ALTER command and to update the table which is not having the primary key

1. Follow the steps to remove the "Safe Update" option in MySQL Workbench of Version 5.2.44.
  • Open the Software(MySQL Workbench).
  • Go to Edit --> Preferences.
  • "Workbench Preferences" window will open. Select the "SQL Queries" Tab.
  • Under "General" section, Uncheck the "Safe Updates". Forbid UPDATEs and DELETEs with no key in WHERE clause or no LIMIT clause. ... option.
  • Close the software and open. So settings are apply to the next query execution.
2. Or Directly adding the following statement to beginning of the query execution.

           SET SQL_SAFE_UPDATES=0;

This is common error face by the beginners of MySQL Users / Workbench users while Truncating, Altering or updating the tables.

No comments:

Post a Comment