mysql: --i-am-a-dummy

I just noticed the mysql client “--i-am-a-dummy” parameter in the help output (from mysql --help)
This interestingly named synonym for “--safe-updates” looks like it should be set as the default on any live mysql database. The command is supposed to block updates and deletes that don’t use keys. As an example, it could be used to protect against the proverbial (but not uncommon) “dummy” entering a command like:
UPDATE users SET password = PASSWORD('secret');
instead of the intended command:
UPDATE users SET password = PASSWORD('secret') WHERE user_id = 521;

This entry was posted in Software. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

One Comment

  1. Posted October 9, 2007 at 2:40 pm | Permalink

    Good find Martin.

    I checked each of the recommended/sample .cnf files that come with the Solaris Coolstack 1.1 version of MySQL and, in each case, the “safe-updates” setting is turned off (commented out) by default.

    However, what is strange is that one of these sample files has a line above the commented out setting saying, “Only allow UPDATEs and DELETEs that use keys” but all of the others say, “Remove the next comment character if you are not familiar with SQL”.

    In any case, enabling this setting was a simple matter of commenting out the “safe-updates” setting the /etc/my.cnf and restarting MySQL.

Post a Comment

You must be logged in to post a comment.