Archive for the ‘mysql’ tag
Installing mysql gem with bundler on Snow Leopard

Between 0.9.26, RC and final 1.0 release, bundler went thru some heavy changes with respect to command line options it supports. Luckily, twitter, forum and blogs kept everybody in the loop.
The blogs, however, became obsolete quickly and even blog posts few months old don’t work with latest version of bundler. We came across this issue that kept is in a loop for a while.
Snow Leopard changed a few things with ruby and mysql gem when it came out. Most mysql installation issues are hammered out by now and are well documented.
mysql user management idiosyncracies
Ok, we are all used to adding new user in mysql with following command:
GRANT ALL ON [db].* TO [user].’%’ IDENTIFIED BY ‘[PASS]‘
So, what happens when you added user before creating the said database. Well, as I found out, mysql won’t complain. Oh well, so what happens if you create the database for the user after the fact. No, it won’t back fix the privileges.
So, I had to delete and recreate the user. Having not done this before, I just tried:
DROP USER [user]
and it worked! The only caveat here is if you added the original user for a particular host, you have to specify host when deleting, like this:
DROP User [user]@’[host]‘
Re-creating the user fixed the problem.
Enjoy!