The Boston Diaries

The ongoing saga of a programmer who doesn't live in Boston, nor does he even like Boston, but yet named his weblog/journal “The Boston Diaries.”

Go figure.

Wednesday, March 04, 2009

Insane “out-of-the-box” thinking

Last night's redacted rant (okay, technically very early this morning) had to do with a crisis of confidence at work (the proverbial straw last night was replying to a trouble ticket with a huge rant with some fairly strong language <cough cough> about package management systems and forgetting to tick the “staff only” option—oops) and wondering why Smirk even puts up with my curmudgeonly tendencies.

I guess I found out why today. Smirk called with a rather interesting problem. One of our clients lost the administrative password to MySQL and could we reset it? We didn't have the administrative password either. Smirk tried the “recommended procedure” in this case:

  1. Shutdown MySQL: /etc/init.d/mysql stop
  2. Restart MySQL with an option to bypass authentication: mysqld_safe skip-grant-tables &
  3. Reset the administrative password: mysqladmin -u root password "newpassword" (or some variation on this—there are several different ways to do this actually)
  4. Shutdown MySQL—here you may need to find the process id and kill it, since you didn't use the startup scripts to start it.
  5. Restart MySQL using the startup scripts: /etc/init.d/mysql start

only to fail in step three. That's when he called me.

I did get the password reset, which is what Smirk (and the customer) really wanted. What I did not do was:

  1. Shutdown MySQL: /etc/init.d/mysql stop
  2. Create the text file $HOME/mysql-init with the following contents:
    UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
  3. Restart MySQL: mysqld_safe --init-file=$HOME/mysql-init &
  4. Delete the text file: /bin/rm $HOME/mysql-init

(as I found out after the fact). No, I think differently. I live on the edge. I do things the hard core way:

  1. Shutdown MySQL: /etc/init.d/mysql stop
  2. Copy critical files: /var/lib/mysql/mysql/user.* /tmp/
  3. Using a binary editor, zero out the administrative password in the file /var/lib/mysql/mysql/user.MYD (told you I live on the edge, and yes, I used a binary editor I wrote for this—Muahahahaha!)
  4. Restart MySQL: /etc/init.d/mysql start
  5. Reset the administrative password for MySQL

I think Smirk keeps me around for my “out-of-the-box” (or is that “out-of-my-ever-loving-mind”?) thinking.

Obligatory Picture

[“I am NOT a number, I am … a Q-CODE!”]

Obligatory Contact Info

Obligatory Feeds

Obligatory Links

Obligatory Miscellaneous

You have my permission to link freely to any entry here. Go ahead, I won't bite. I promise.

The dates are the permanent links to that day's entries (or entry, if there is only one entry). The titles are the permanent links to that entry only. The format for the links are simple: Start with the base link for this site:, then add the date you are interested in, say 2000/08/01, so that would make the final URL:

You can also specify the entire month by leaving off the day portion. You can even select an arbitrary portion of time.

You may also note subtle shading of the links and that's intentional: the “closer” the link is (relative to the page) the “brighter” it appears. It's an experiment in using color shading to denote the distance a link is from here. If you don't notice it, don't worry; it's not all that important.

It is assumed that every brand name, slogan, corporate name, symbol, design element, et cetera mentioned in these pages is a protected and/or trademarked entity, the sole property of its owner(s), and acknowledgement of this status is implied.

Copyright © 1999-2024 by Sean Conner. All Rights Reserved.