Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am building a ruby on rails application using mysql for storing application related data. My application has a user console and admin console. Access to admin console is restricted to administrators. How do I mark a user as admin in mysql database.

share|improve this question
    
Dunno. How does your application determine that someone is an admin? –  Ignacio Vazquez-Abrams Nov 13 '10 at 16:36
    
Thanks. I thought it was a mysql configuration. Didn't know it was application dependent. –  ardsrk Nov 13 '10 at 17:13

1 Answer 1

Easy to mark a user as admin inside of mysql -
add another mysql user as documented here: http://dev.mysql.com/doc/refman/5.1/en/adding-users.html
and grant them appropriate permissions as documented here: http://dev.mysql.com/doc/refman/5.1/en/grant.html

as to connecting to the database as separate users, that's another ball of wax with overriding methods...

or are you talking about making an admin flag in the users table...that's a column with the boolean type

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.