martinmurphy.com – Martin Murphy

Martin Murphy’s Weblog

mysql: --i-am-a-dummy

with one comment

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;

Written by Martin Murphy

October 9th, 2007 at 12:17 pm

Posted in Software

One Response to 'mysql: --i-am-a-dummy'

Subscribe to comments with RSS or TrackBack to 'mysql: --i-am-a-dummy'.

  1. 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.

    jmernin

    9 Oct 07 at 2:40 pm

Leave a Reply

You must be logged in to post a comment.

SEO Powered by Platinum SEO from Techblissonline