|
|
--i-am-a-dummy option for safe updates - Mysql
|
Views : 412
|
|
Tagged in : Mysql
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
It's an option for beginners that has the same effect as --safe-updates. The --i-am-a-dummy option is very helpful because it prevents accidents. If you execute the SQL statement:
DELETE FROM table_name
what happens? You delete all rows from the table. With the --i-am-a-dummy option:
# You cannot delete or update rows without specifying the key values that identify them or providing a LIMIT clause
# All large select are automatically limited to 1,000 rows unless the statement includes a LIMIT clause.
# Multiple-table SELECT statements that probably need to examine more than 1,000,000 row combinations are aborted.
Example:
mysql --i-am-a-dummy -uuser_name -puser_password
Replace the user_name and user_password with your MySQL user name and password
mysql> delete from table_name;
ERROR 1175: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column |
|
By - Rekha, On - 2009-11-13 |
|
|
|