Reset MySQL Password on OS X Lion

In case you forgot or didn’t set the password for “root,” do the following:

1. Create a file called mysql-init with the following entries (I placed mine in my home directory):

UPDATE mysql.user SET Password=PASSWORD(‘MyNewPass’) WHERE User=’root’;
FLUSH PRIVILEGES;
2. Make sure mysqld is not running (i.e. terminal > ps -ef | grep mysql)

3. Run mysql with the following command:

mysqld_safe –init-file=/home/me/mysql-init &

4. Try logging in with root: mysql -u root -p

5. You can now delete mysql-init and start mysql in the normal way: mysql.server start

Note: I tried mysqld –skip-grant-tables, but it didn’t work for me.

Teach yourself programming in ten years

Here’s an interesting article that Peter Norvig wrote about how wanna-be programmers are in such a hurry in becoming a full-fledged “developer,” buying into Teach Yourself <some language> in 21 days books and the likes.

I’ve been developing/programming for a while now and to become a developer, a great one, you simply cannot take shortcuts.

Every aspiring or veteran developer should read or re-read Norvig’s Teach Yourself Programming in Ten Years article.

SQL Server Best Practices

For archival purposes, here’s the location of a ton of white papers for best practices or SQL Server on the TechNet site.

Best Practice is a management idea which asserts that there is a technique, method, process, activity, incentive or reward that is more effective at delivering a particular outcome than any other technique, method, process, etc. The idea is that with proper processes, checks, and testing, a desired outcome can be delivered with fewer problems and unforeseen complications. Best practices can also be defined as the most efficient (least amount of effort) and effective (best results) way of accomplishing a task, based on repeatable procedures that have proven themselves over time for large numbers of people.