Ruby on Rails and MySQL issue
Had an issue developing my todo application on Rails. It took me a bit of digging but I finally found out what was going on.
To get going I downloaded XAMPP and started up the MySQL server that got installed with it. That’s where I hit my snag. I started up the MySQL server, generated my scaffold, tried to browse to http://localhost:3000/todo/list and got the following weird error:
ActiveRecord::StatementInvalid in Recipe#indexInvalid argument: SELECT * FROM recipes
“WTF?” I thought to myself. After some digging, I found the answer1. It seems that Rails (smartly) relies on MySQL using its Brand Spankin’ New™ Password Scheme but XAMPP, out of the box, had MySQL configured to use the old password scheme. The upshot was that once I set my passwords in my database.yml to a blank line (don’t try this at home or in production, kids) everything worked out just fine.
Now I just have to get MySQL to use its Brand Spankin’ New™ Password Scheme.
1 This guy seems to be having my problem. This discussion is a good place to start to find out what went wrong.