What permissions does rake db need?

I don’t want to use root with a root password for my rails app. So, I’ve created a user roruser that I want to be able to do what rails needs done. Normally, I create a new user with a new database and grant permissions on that database, but that doesn’t really cut it here as rake db:create complains that the database exists. So, what perms does roruser need to allow for the standard bevy of rake:db tasks?

Well, this works, but it’s not much better than setting up root to have a password and using that:

sudo -s
mysql
CREATE USER 'roruser'@'localhost' IDENTIFIED BY 'roruser';
GRANT ALL ON *.* TO 'roruser'@'localhost' with GRANT option;

replacing pw, of course.

1 Like