This option prevents MySQL from performing update operations unless a key constraint in the WHERE clause and / or a LIMIT clause are provided.

For beginners, a useful startup option is –safe-updates (or –i-am-a-dummy, which has the same effect). It is helpful for cases when you might have issued a DELETE FROM tbl_name statement but forgotten the WHERE clause. Normally, such a statement deletes all rows from the table. With –safe-updates, you can delete rows only by specifying the key values that identify them. This helps prevent accidents.

When you use the –safe-updates option, mysql issues the following statement when it connects to the MySQL server:

To specify limits different from 1,000 and 1,000,000, you can override the defaults by using the –select_limit and –max_join_size options:

mysql: –i-am-a-dummy
Tagged on:     

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.