Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

What is the best practice for keeping and maintaining MySQL users? Say for example I have 5 programmers and a PHP application connecting to a database. Should I create 6 different users 1 for each of the users and 1 for the application?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Can you please clarify Users vs Programmers? Typically this is how it is done:

1) Create three identical schemas and name them PROD, QA and DEV. Their names are self explanatory.

2) Create a dbuser for the application (PHP) use on each of them. If your app is MYAPP, name the dbuser myapp. This is the login the application uses on behalf of every application user.

3) Create a dbuser called dbadmin on each of them and give it to your DBA.

4) Create a dbuser called myapp_dev on each of them and give it to your developers.

share|improve this answer
    
I have seen well-organized client at my employer's web hosting company do thi kind of setup over and over again. It makes the most sense to have a sort of chain-of-command when it comes to programmers using PROD/QA/DEV. Some take liberties and make unauthorized changes in DEV and propogates dev changes to QA and PROD all because user administration was not given due attention. This, this answer is a +1 !!! –  RolandoMySQLDBA Jul 3 '12 at 20:52
    
users I mean just the MySQL login username and programmers would be my staff who make changes to the PHP application. –  Robert Jul 5 '12 at 13:04
add comment

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.