HOWTO reset a MySQL root password

If your a terrible DBA like me here are the six steps to reset a forgotten MySQL root user password:

1. stop mysql

# /etc/init.d/mysql stop

The output should look like this:

* Stopping MySQL database server mysqld

   …done.

2. restart mysql without a password

# mysqld_safe –skip-grant-tables &

The output should look like this:

[1] 28808

100222 18:32:27 mysqld_safe Logging to syslog.

100222 18:32:27 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

3. connect to mysql using the mysql client

# mysql -u root

The output should look like this:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.1.37-1ubuntu5.1 (Ubuntu)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

4. set a new mysql root user password

mysql> use mysql;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

mysql> update user set password=PASSWORD(“NEWROOTPASSWORDHERE“) where User=’root’;

Query OK, 0 rows affected (0.02 sec)

Rows matched: 3 Changed: 0 Warnings: 0

mysql> flush privileges;

Query OK, 0 rows affected (0.09 sec)

mysql> quit

Bye

5. stop mysql

# /etc/init.d/mysql stop

The output should look like this:

* Stopping MySQL database server mysqld

100222 18:35:29 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

   …done.

[1]+ Done mysqld_safe –skip-grant-tables

6. restart mysql

# /etc/init.d/mysql start

Who needs to remember passwords? :)

the iPad

I don’t grok all the aversion in the techie/gadget press in regards to the iPad.

Do I want one (yet)? No; however, it seems like a pretty ideal device for someone like my wife or father-in-law. They both have pretty typical computing needs – a browser, email, iTunes for media consumption, the occasional word processing. The iPad nails all of these functions out of the box plus has the added bonus of the App Store ecosystem so there are plenty of niche specific apps and casual games to enjoy as well. It seems like a step closer to that task-centric “toaster” computing model which I think aligns well to the expectations of a large part of the population. Panic’s Steven Frank describes this personal computing evolution much more eloquently.

Right now I just want to finally ditch my current Moto dumbphone and get an iPhone. I’m not ready to make the leap to AT&T yet so I was disappointed that the end of their exclusivity for it in the US wasn’t announced this week. Oh well maybe in time for my birthday :)

Dreamcast

“It’s been 10 years since 9/9/1999, when the Dreamcast launched on American shores. The hardware was ahead of its time

[From Slashdot Games Story | Sega Dreamcast Turns 10]

Wow its hard to believe 10 years ago today I first purchased a Dreamcast. I still have fond memories of playing Virtua Tennis with JonahPhilippoussis FTW! Its too bad I parted with mine a few years ago for credit towards purchasing my Wii.